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

Exception when none of the hostnames can be resolved #21

Open
fjansson opened this issue Jan 13, 2019 · 0 comments
Open

Exception when none of the hostnames can be resolved #21

fjansson opened this issue Jan 13, 2019 · 0 comments

Comments

@fjansson
Copy link

If the list of host names contains only addresses that cannot be resolved, and ignore_lookup_errors is True, multi_ping fails.

#!/usr/bin/python                                                                                                                                                                                                                                                               
from multiping import multi_ping                                                                                                        
responses, no_responses = multi_ping(["no-such-host", "also-this-doesnt-exist"], timeout=2, retry=0, ignore_lookup_errors=True)         
Traceback (most recent call last):
  File "./test_multiping.py", line 4, in <module>
    responses, no_responses = multi_ping(["no-such-host", "also-this-doesnt-exist"], timeout=2, retry=0, ignore_lookup_errors=True)
  File "/usr/local/lib/python2.7/dist-packages/multiping/__init__.py", line 485, in multi_ping
    single_results, no_results = mp.receive(retry_timeout)
  File "/usr/local/lib/python2.7/dist-packages/multiping/__init__.py", line 376, in receive
    raise MultiPingError("No requests have been sent, yet.")
multiping.MultiPingError: No requests have been sent, yet.

The correct behavior would be to return the failing host names in the no_response array.

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

1 participant