Method
_sanitize_interface_name
(self, value: Optional[str])
Source from the content-addressed store, hash-verified
| 491 | # Helpers |
| 492 | # ------------------------------------------------------------------ |
| 493 | def _sanitize_interface_name(self, value: Optional[str]) -> Optional[str]: |
| 494 | if value is None: |
| 495 | return None |
| 496 | candidate = str(value).strip() |
| 497 | if not candidate: |
| 498 | return None |
| 499 | if not self._iface_pattern.match(candidate): |
| 500 | raise ValueError('Invalid interface name') |
| 501 | return candidate |
| 502 | |
| 503 | def _auto_focus_interface(self) -> Optional[str]: |
| 504 | default_iface = self._default_iface |
Tested by
no test coverage detected