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

Fix healthcheck.py script to accept the loopback IP #216

Closed
wants to merge 1 commit into from
Closed

Fix healthcheck.py script to accept the loopback IP #216

wants to merge 1 commit into from

Conversation

charlescng
Copy link
Contributor

IPs that are considered loopback IPs were not added to the addresses list. This caused the healthcheck.py script to not run.

@thomas-mangin

@coveralls
Copy link

coveralls commented Jan 16, 2015

Coverage Status

Coverage remained the same at 45.663% when pulling 29d3227 on charlescng:master into 933d9ad on Exa-Networks:master.

@thomas-mangin
Copy link
Member

Thank you very much for this patch, I will wait for @vincentbernat to comment before pulling.

@vincentbernat
Copy link
Member

Well, I don't understand the problem nor the fix. is_loopback is true for 127.0.0.0/8-like addresses. We don't want to advertise those. You either need to add some non-loopback addresses on lo or use --ip to tell which IP you want to advertise.

@charlescng
Copy link
Contributor Author

It was failing during the loopback IP retrieval.

processes/healthcheck.py --config healthcheck.conf --ip 192.168.99.2
DEBUG[healthcheck] Retrieve loopback IP addresses
ERROR[healthcheck] Uncatched exception: No loopback IP found
Traceback (most recent call last):
  File "processes/healthcheck.py", line 428, in <module>
    setup_ips(options.ips, options.label)
  File "processes/healthcheck.py", line 248, in setup_ips
    existing = set(loopback_ips(label))
  File "processes/healthcheck.py", line 242, in loopback_ips
    raise RuntimeError("No loopback IP found")
RuntimeError: No loopback IP found

I did not run into this when adding the --no-ip-setup flag to my setup, which is what I want to do regardless.

I don't think I quite follow the method's intentions but close this PR if you're happy with the code as-is.

Thanks for looking into it.

vincentbernat added a commit to vincentbernat/exabgp that referenced this pull request Jan 19, 2015
When no loopback IPs are present and the IPs are specified on the
command-line instead, we still trigger an error due to a check in the
function retrieving the loopback IPs. We move this check in the outer
program instead. The check will fail only if there is no loopback IPs
and no IP specified on the command-line.

This should fix Exa-Networks#216.
vincentbernat added a commit to vincentbernat/exabgp that referenced this pull request Jan 19, 2015
When no loopback IPs are present and the IPs are specified on the
command-line instead, we still trigger an error due to a check in the
function retrieving the loopback IPs. We move this check in the outer
program instead. The check will fail only if there is no loopback IPs
and no IP specified on the command-line.

This should fix Exa-Networks#216.
@vincentbernat
Copy link
Member

OK, I understand the problem better. I have opened another PR (#217) with the appropriate fix.

@charlescng charlescng closed this Jan 19, 2015
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

Successfully merging this pull request may close these issues.

None yet

4 participants