Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing api URL disturbs target application #34

Open
xhujerr opened this issue Mar 4, 2015 · 9 comments
Open

Printing api URL disturbs target application #34

xhujerr opened this issue Mar 4, 2015 · 9 comments

Comments

@xhujerr
Copy link

xhujerr commented Mar 4, 2015

Method HTTPClient.do_call() (http.py, line 101) unconditionally echoes url. I use pyrabbit in an agent which catches and parses stdout. Echoed url causes error since is unexpected by the agent.

I see two possible solutions:

  1. The url is a debug message and thus it shall be removed.
  2. The url printing is useful somehow. Then the client class shall have option silent=False. If set to true, the url won't be echoed.
@xhujerr
Copy link
Author

xhujerr commented Mar 4, 2015

Ok. Now I see there are already several merge requests for this bug. The least intrusive from jofusa.

Can you merge that please?

@stephane-martin
Copy link

+1, please :)

@ricardoklein
Copy link

+1

2 similar comments
@Rajlaxmi
Copy link

+1

@rnt
Copy link

rnt commented Sep 10, 2016

+1

@sclooney94
Copy link

Hi I'm still having this issue with the latest pip install of pyrabbit (1.1.0). Everytime I use the client it prints the url, when I use "pip install -U git+https://github.com/bkjones/pyrabbit.git" it removes this issue but I then get;

Traceback (most recent call last):
File "messages.py", line 13, in
all_queue_names = [str(q['name']) for q in cl.get_queues()]
File "/home/anaconda2/lib/python2.7/site-packages/pyrabbit/api.py", line 478, in get_queues
queues = self._call(path, 'GET')
File "/home/anaconda2/lib/python2.7/site-packages/pyrabbit/api.py", line 108, in _call
resp = self.http.do_call(path, method, body, headers)
File "/home/anaconda2/lib/python2.7/site-packages/pyrabbit/http.py", line 102, in do_call
raise HTTPError(content, resp.status_code, resp.text, path, body)
pyrabbit.http.HTTPError: 404 - Not found. (None) (queues) (None)

This appear when trying to run a very basic code ?

from pyrabbit.api import Client

cl = Client('localhost:15672', 'guest', 'guest')
all_queue_names = [str(q['name']) for q in cl.get_queues()]

any help would be greatly appreciated

@morganchristiansson
Copy link

morganchristiansson commented Apr 13, 2017

+1

This is fixed in master but not latest v1.1.0 release https://github.com/bkjones/pyrabbit/blob/v1.1.0/pyrabbit/http.py#L101

I'm redirecting stdout to /dev/null as a workaround >/dev/null

@ShibaBandit
Copy link

+1

@deslum
Copy link

deslum commented Jul 24, 2017

I fork and update module. Welcome https://github.com/deslum/pyrabbit2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants