MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / get

Method get

pager_lib/getmac/getmac.py:1218–1228  ·  view source on GitHub ↗
(self, arg="")

Source from the content-addressed store, hash-verified

1216 return check_command("route")
1217
1218 def get(self, arg=""): # type: (str) -> Optional[str]
1219 output = _popen("route", "get default")
1220
1221 if not output:
1222 return None
1223
1224 try:
1225 return output.partition("interface: ")[2].strip().split()[0].strip()
1226 except IndexError as ex:
1227 log.debug("DefaultIfaceRouteCommand failed for %s: %s", arg, str(ex))
1228 return None
1229
1230
1231class DefaultIfaceIpRoute(Method):

Callers

nothing calls this directly

Calls 2

_popenFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected