summaryrefslogtreecommitdiff
path: root/bin
diff options
authorPMR <pmr@pmr-lander>2020-07-09 10:35:49 +0000
committerPMR <pmr@pmr-lander>2020-07-09 10:35:49 +0000
commit52de331f565d4a0067f8b4e81db34e1f4238b831 (patch)
tree0b830c126ed4db453e8ddef0fcc4b4bd6a5bb1a6 /bin
parent3fa2624c9c6f107b1617c5c0f187498d3258d5e4 (diff)
parentdbcf4c2f421605963e0c1780967c6f5261ab0505 (diff)
Merge #387049 from ~jocave/plainbox-provider-checkbox:gateway-networkctl-fix
Diffstat (limited to 'bin')
-rwxr-xr-xbin/gateway_ping_test11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/gateway_ping_test b/bin/gateway_ping_test
index 7bac0f8..47dcfda 100755
--- a/bin/gateway_ping_test
+++ b/bin/gateway_ping_test
@@ -138,11 +138,12 @@ def get_host_to_ping(interface=None, verbose=False, default=None):
try:
output = subprocess.check_output(cmd, shell=True)
for line in output.decode(sys.stdout.encoding).splitlines():
- key, val = line.strip().split(':', maxsplit=1)
- if key == "Gateway":
- subprocess.check_output(["ping", "-q", "-c", "1", val],
- stderr=subprocess.STDOUT)
- break
+ vals = line.strip().split(' ')
+ if len(vals) >= 2:
+ if vals[0] == 'Gateway:':
+ subprocess.check_output(["ping", "-q", "-c", "1", vals[1]],
+ stderr=subprocess.STDOUT)
+ break
except subprocess.CalledProcessError:
pass
ARP_POPULATE_TRIES = 10