Skip to content

Commit

Permalink
healthcheck: don't raise an error when specifying IP on the command-line
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vincentbernat committed Jan 19, 2015
1 parent aaded19 commit 0e3afcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions etc/exabgp/processes/healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,6 @@ def loopback_ips(label):
if not lmo or not lmo.group("label").startswith(label):
continue
addresses.append(ip)
if not addresses:
raise RuntimeError("No loopback IP found")
logger.debug("Loopback addresses: {0}".format(addresses))
return addresses

Expand Down Expand Up @@ -423,6 +421,8 @@ def trigger(target):
try:
# Setup IP to use
options.ips = options.ips or loopback_ips(options.label)
if not options.ips:
raise RuntimeError("No IP found")
if options.ip_setup:
setup_ips(options.ips, options.label)
options.ips = collections.deque(options.ips)
Expand Down

0 comments on commit 0e3afcb

Please sign in to comment.