Get the hardware address on Unix by running ifconfig.
()
| 573 | # The following functions call external programs to 'get' a macaddr value to |
| 574 | # be used as basis for an uuid |
| 575 | def _ifconfig_getnode(): |
| 576 | """Get the hardware address on Unix by running ifconfig.""" |
| 577 | # This works on Linux ('' or '-a'), Tru64 ('-av'), but not all Unixes. |
| 578 | keywords = (b'hwaddr', b'ether', b'address:', b'lladdr') |
| 579 | for args in ('', '-a', '-av'): |
| 580 | mac = _find_mac_near_keyword('ifconfig', args, keywords, lambda i: i+1) |
| 581 | if mac: |
| 582 | return mac |
| 583 | return None |
| 584 | |
| 585 | def _ip_getnode(): |
| 586 | """Get the hardware address on Unix by running ip.""" |
nothing calls this directly
no test coverage detected
searching dependent graphs…