pyrabbit
pyrabbit copied to clipboard
set_vhost_permissions raises NetworkError
I'm using pyrabbit version 1.1.0 with RabbitMQ-3.6.0
Below is the python code I have written using pyrabbit
from pyrabbit.api import Client cl = Client('localhost:15672', 'guest', 'guest') print cl.is_alive() cl.create_vhost('example_vhost') print cl.get_vhost_names() print cl.get_vhost_permissions('example_vhost') cl.set_vhost_permissions('example_vhost', 'guest', '.', '.', '.*')
The output of script shows a NetworkError as shown below:
True
[u'/', u'example_vhost']
None
Traceback (most recent call last):
File "C:\Gayatri\learning\test_pyrabbit.py", line 14, in
Any help to resolve this issue?
Thanks in Advance, Gayatri
looks like i got the same issue: [rabbitCli.create_vhost(vHost) for vHost, ex in mqCfg['exchanges']] [rabbitCli.set_vhost_permissions(vHost, user, '.', '.', '.*' for vHost, ex in mqCfg['exchanges']] [rabbitCli.create_exchange(vHost, ex, 'topic') for vHost, ex in mqCfg['exchanges']]
at my case mqCfg['exchanges'] returns 7 items
- never got error at line 1
- about every second time line 2 made error
- if line 2 is ok, almost every time 3-rd line made error
about 70% of error is 10054, rest ones - 10053
I fork and update module. Welcome https://github.com/deslum/pyrabbit2