diff --git a/napalm_procurve/parsers.py b/napalm_procurve/parsers.py index 01a15a2..ac9b835 100644 --- a/napalm_procurve/parsers.py +++ b/napalm_procurve/parsers.py @@ -199,13 +199,16 @@ def parse_model_from_version(output: str) -> tuple[str, str]: 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): + # Find the HP/Aruba product banner line — may not be the first line + # (older ProCurve shows "Image stamp:" first, banner follows later) + banner = "" + for line in output.splitlines(): + if re.match(r"\s*(?:HP|HPE|Aruba)\b", line, re.I): + banner = line.strip() + break + if not banner: return "", "" + first = banner # Extract J-code part number _PN_RE_V = re.compile(r"\b(J\d{4}[A-Z]{1,2})\b")