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

Method get

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

Source from the content-addressed store, hash-verified

381 return False
382
383 def get(self, arg): # type: (str) -> Optional[str]
384 from uuid import _arp_getnode # type: ignore
385
386 backup = socket.gethostbyname
387 try:
388 socket.gethostbyname = lambda x: arg # noqa: F841
389 mac1 = _arp_getnode()
390 if mac1 is not None:
391 mac1 = _uuid_convert(mac1)
392 mac2 = _arp_getnode()
393 mac2 = _uuid_convert(mac2)
394 if mac1 == mac2:
395 return mac1
396 except Exception:
397 raise
398 finally:
399 socket.gethostbyname = backup
400
401 return None
402
403
404class ArpFile(Method):

Callers

nothing calls this directly

Calls 1

_uuid_convertFunction · 0.85

Tested by

no test coverage detected