make get_facts sgx00 compatible

This commit is contained in:
Daniel Bacher committed 2020-10-30 09:11:35 +01:00
1 parent ae33f4cc40
commit 5bc1bce26f
1 file changed
+13 -5
+13 -5
View File
@@ -198,11 +198,19 @@ class S350Driver(NetworkDriver):
show_int_st = self._send_command('show interface status') show_int_st = self._send_command('show interface status')
# os_version # os_version
for line in show_ver.splitlines(): # detect os ver > 2
# First version line is the active version if 'Active-image' in show_ver:
if 'Version' in line: for line in show_ver.splitlines():
_, os_version = line.split('Version: ') # First version line is the active version
break if 'Version' in line:
_, os_version = line.split('Version: ')
break
else:
for line in show_ver.splitlines():
if 'SW version' in line:
_, ver = line.split(' ')
os_version, _ = ver.split(' (')
break
# hostname, uptime # hostname, uptime
for line in show_sys.splitlines(): for line in show_sys.splitlines():