(self, arg)
| 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 | |
| 702 | class SysIfaceFile(Method): |