From c186d506e4fa7e0c9a254af9b0d283fc4af48dde Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Wed, 18 Nov 2015 14:49:54 +0000 Subject: [PATCH] Resolve "Felix dies if interface missing" on Alpine Alpine and Ubuntu have slightly different error messages when you run 'ip link show '; respectively ip: can't find device 'thisdoesnotexist' Device "thisdoesnotexist" does not exist. We run Felix inside an Alpine container for calico/node, but the different wording meant Felix didn't recognise the missing interface as a known error, so raised an exception. Now we catch both wordings and handle them correctly. Fixes #899. --- calico/felix/devices.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/calico/felix/devices.py b/calico/felix/devices.py index 736c481f28..e3128e6376 100644 --- a/calico/felix/devices.py +++ b/calico/felix/devices.py @@ -91,7 +91,8 @@ def interface_exists(interface): futils.check_call(["ip", "link", "list", interface]) return True except futils.FailedSystemCall as fsc: - if fsc.stderr.count("does not exist") != 0: + if ("does not exist" in fsc.stderr) or \ + ("can't find device" in fsc.stderr): return False else: # An error other than does not exist; just pass on up