Skip to content

Commit 3ca37b6

Browse files
committed
AMQP: Strip leading / in vhost
Was causing connection problems when specified
1 parent ba8f01a commit 3ca37b6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

msgflo/msgflo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@ def __init__(self, broker, discovery_period=None):
107107
Engine.__init__(self, broker, discovery_period=discovery_period)
108108

109109
# Prepare connection to AMQP broker
110-
vhost = self.broker_info.path or '/'
110+
vhost = '/'
111+
if self.broker_info.path:
112+
vhost = self.broker_info.path[1:]
111113
host = self.broker_info.hostname or 'localhost'
112114
port = self.broker_info.port or 5672
113115
user = self.broker_info.username or 'guest'
114116
password = self.broker_info.password or 'guest'
117+
logger.debug("Using %s:%d %s %s:%s" % (host, port, vhost, user, password))
115118
self._conn = haigha_Connection(transport='gevent', close_cb=self._connection_closed_cb,
116119
host=host, vhost=vhost, port=port, user=user, password=password,
117120
logger=logger)

0 commit comments

Comments
 (0)