(self, arg)
| 961 | return check_command("ifconfig") |
| 962 | |
| 963 | def get(self, arg): # type: (str) -> Optional[str] |
| 964 | # Check if this version of "ifconfig" accepts an interface argument |
| 965 | command_output = "" |
| 966 | |
| 967 | if not self._tested_arg: |
| 968 | try: |
| 969 | command_output = _popen("ifconfig", arg) |
| 970 | self._iface_arg = True |
| 971 | except CalledProcessError: |
| 972 | self._iface_arg = False |
| 973 | self._tested_arg = True |
| 974 | |
| 975 | if self._iface_arg and not command_output: # Don't repeat work on first run |
| 976 | command_output = _popen("ifconfig", arg) |
| 977 | else: |
| 978 | command_output = _popen("ifconfig", "") |
| 979 | |
| 980 | return _parse_ifconfig(arg, command_output) |
| 981 | |
| 982 | |
| 983 | # TODO: create new methods, IfconfigNoArgs and IfconfigVariousArgs |
nothing calls this directly
no test coverage detected