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

Method get

pager_lib/getmac/getmac.py:687–699  ·  view source on GitHub ↗
(self, arg)

Source from the content-addressed store, hash-verified

685 return check_command("ip")
686
687 def get(self, arg): # type: (str) -> Optional[str]
688 output = _popen("ip", "neighbor show %s" % arg)
689 if not output:
690 return None
691
692 try:
693 # NOTE: the space prevents accidental matching of partial IPs
694 return (
695 output.partition(arg + " ")[2].partition("lladdr")[2].strip().split()[0]
696 )
697 except IndexError as ex:
698 log.debug("IpNeighborShow failed with exception: %s", str(ex))
699 return None
700
701
702class SysIfaceFile(Method):

Callers

nothing calls this directly

Calls 2

_popenFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected