(iface, command_output)
| 911 | |
| 912 | |
| 913 | def _parse_ifconfig(iface, command_output): |
| 914 | # type: (str, str) -> Optional[str] |
| 915 | if not iface or not command_output: |
| 916 | return None |
| 917 | |
| 918 | # Sanity check on input e.g. if user does "eth0:" as argument |
| 919 | iface = iface.strip(":") |
| 920 | |
| 921 | # "(?:^|\s)": prevent an input of "h0" from matching on "eth0" |
| 922 | search_re = r"(?:^|\s)" + iface + IFCONFIG_REGEX |
| 923 | |
| 924 | return _search(search_re, command_output, flags=re.DOTALL) |
| 925 | |
| 926 | |
| 927 | class IfconfigWithIfaceArg(Method): |