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

Method get

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

Source from the content-addressed store, hash-verified

1199 return check_command("route")
1200
1201 def get(self, arg=""): # type: (str) -> Optional[str]
1202 output = _popen("route", "-n")
1203
1204 try:
1205 return output.partition("0.0.0.0")[2].partition("\n")[0].split()[-1]
1206 except IndexError as ex: # index errors means no default route in output?
1207 log.debug("DefaultIfaceRouteCommand failed for %s: %s", arg, str(ex))
1208 return None
1209
1210
1211class DefaultIfaceRouteGetCommand(Method):

Callers

nothing calls this directly

Calls 2

_popenFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected