diff --git a/napalm_procurve/parsers.py b/napalm_procurve/parsers.py index 2d88a6c..01a15a2 100644 --- a/napalm_procurve/parsers.py +++ b/napalm_procurve/parsers.py @@ -195,11 +195,18 @@ def parse_model_from_version(output: str) -> tuple[str, str]: ``HP J9565A 2520G-8-PoE Switch`` → ("2520G-8-PoE", "J9565A") ``HP J9298A Switch 2520G-8-PoE`` → ("2520G-8-PoE", "J9298A") ``Aruba 2530-8-PoE+ Switch`` → ("2530-8-PoE+", "") + + Returns ("", "") when the first line is not an HP/Aruba device banner + (e.g. when show version starts with "Image stamp:" on newer Aruba). """ first = output.strip().splitlines()[0] if output.strip() else "" if not first: return "", "" + # Only process lines that start with an HP/Aruba product banner + if not re.match(r"\s*(?:HP|HPE|Aruba)\b", first, re.I): + return "", "" + # Extract J-code part number _PN_RE_V = re.compile(r"\b(J\d{4}[A-Z]{1,2})\b") pn_match = _PN_RE_V.search(first)