Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
787f6b37
Commit
787f6b37
authored
Jul 25, 2012
by
Christos Stavrakakis
Browse files
Fix AMQP bug in snf-progress-monitor
parent
b764537a
Changes
3
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-gtools/synnefo/ganeti/eventd.py
View file @
787f6b37
...
...
@@ -115,7 +115,7 @@ class JobFileHandler(pyinotify.ProcessEvent):
def
__init__
(
self
,
logger
):
pyinotify
.
ProcessEvent
.
__init__
(
self
)
self
.
logger
=
logger
self
.
client
=
AMQPClient
(
confirm_buffer
=
25
)
self
.
client
=
AMQPClient
(
hosts
=
settings
.
AMQP_HOSTS
,
confirm_buffer
=
25
)
handler_logger
.
info
(
"Attempting to connect to RabbitMQ hosts"
)
self
.
client
.
connect
()
self
.
client
.
exchange_declare
(
settings
.
EXCHANGE_GANETI
,
type
=
'topic'
)
...
...
snf-cyclades-gtools/synnefo/ganeti/hook.py
View file @
787f6b37
...
...
@@ -158,7 +158,8 @@ class GanetiHook():
# FIXME: We need a reconciliation mechanism between the DB and
# Ganeti, for cases exactly like this.
self
.
client
=
AMQPClient
(
max_retries
=
2
*
len
(
settings
.
AMQP_HOSTS
))
self
.
client
=
AMQPClient
(
hosts
=
settings
.
AMQP_HOSTS
,
max_retries
=
2
*
len
(
settings
.
AMQP_HOSTS
))
self
.
client
.
connect
()
def
on_master
(
self
):
...
...
snf-cyclades-gtools/synnefo/ganeti/progress_monitor.py
View file @
787f6b37
...
...
@@ -130,8 +130,9 @@ def main():
# determine the routekey for AMPQ
prefix
=
opts
.
instance_name
.
split
(
'-'
)[
0
]
routekey
=
"ganeti.%s.event.progress"
%
prefix
amqp_client
=
AMQPClient
()
amqp_client
=
AMQPClient
(
hosts
=
settings
.
AMQP_HOSTS
,
confirm_buffer
=
2
)
amqp_client
.
connect
()
amqp_client
.
exchange_declare
(
settings
.
EXCHANGE_GANETI
,
type
=
'topic'
)
pid
=
os
.
fork
()
if
pid
==
0
:
...
...
@@ -202,6 +203,8 @@ def main():
# Sleep for a while
time
.
sleep
(
3
)
amqp_client
.
close
()
if
__name__
==
"__main__"
:
sys
.
exit
(
main
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment