We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbace6e commit e1255d9Copy full SHA for e1255d9
testinfra/modules/interface.py
@@ -11,6 +11,7 @@
11
# limitations under the License.
12
13
import json
14
+import re
15
16
from testinfra.modules.base import Module
17
from testinfra.utils import cached_property
@@ -147,7 +148,9 @@ def default(cls, family=None):
147
148
out = cls.check_output("{} route ls".format(_default._ip))
149
for line in out.splitlines():
150
if "default" in line:
- _default.name = line.strip().rsplit(" ", 1)[-1]
151
+ match = re.search(r"dev\s(\S+)", line)
152
+ if match:
153
+ _default.name = match.group(1)
154
return _default
155
156
@classmethod
0 commit comments