Skip to content

Commit 66a46d3

Browse files
authored
Node: fix SONiC detection, and bug fix (#919)
The newer SONiC versions have a different string to match to extract the version. Add that. Plus, fix a bug in extracting the version during device init. Signed-off-by: Dinesh Dutt <[email protected]>
1 parent eddb708 commit 66a46d3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

suzieq/config/textfsm_templates/sonic_showsys.tfsm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Start
99
^${bootupTimestamp}.*$$
1010
^\s*Architecture:\s+${architecture}\s*$$
1111
^SONiC Software Version\s*:\s*${version}\s*$$
12+
^Software\s+Version\s*:\s*${version}.*$$
1213
^Product: Enterprise SONiC Distribution by\s*${vendor}\s*$$
1314
^HwSKU\s*:\s+${model}\s*$$
1415
^Serial Number: ${serialNumber}

suzieq/poller/worker/nodes/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,7 +2093,7 @@ async def _parse_init_dev_data_devtype(self, output, cb_token) -> None:
20932093
if (len(output) > 1) and (output[1]["status"] == 0):
20942094
self.hostname = output[1]["data"].strip()
20952095
if (len(output) > 2) and (output[2]["status"] == 0):
2096-
self._extract_nos_version(output[1]["data"])
2096+
self._extract_nos_version(output[2]["data"])
20972097

20982098
def _extract_nos_version(self, data: str) -> None:
20992099
match = re.search(r'Version:\s+SONiC-OS-([^-]+)', data)

0 commit comments

Comments
 (0)