Skip to content

Commit

Permalink
check before pop, check sw_cversion in telemetryStatsServerP check (#116
Browse files Browse the repository at this point in the history
)
  • Loading branch information
monrog2 authored May 6, 2024
1 parent 45a307c commit 043fa78
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions aci-preupgrade-validation-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,13 +718,13 @@ def get_switch_version(**kwargs):
for firmware in firmwares:
versions.add(firmware['firmwareRunning']['attributes']['peVer'])

lowest_sw_ver = AciVersion(versions.pop())
for version in versions:
version = AciVersion(version)
if lowest_sw_ver.newer_than(str(version)):
lowest_sw_ver = version
if versions:
lowest_sw_ver = AciVersion(versions.pop())
for version in versions:
version = AciVersion(version)
if lowest_sw_ver.newer_than(str(version)):
lowest_sw_ver = version

prints('%s\n' % lowest_sw_ver)
return lowest_sw_ver

def apic_cluster_health_check(index, total_checks, cversion, **kwargs):
Expand Down Expand Up @@ -2536,8 +2536,8 @@ def telemetryStatsServerP_object_check(index, total_checks, sw_cversion=None, tv
doc_url = 'https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvt47850'
print_title(title, index, total_checks)

if not tversion:
print_result(title, MANUAL, 'Target version not supplied. Skipping.')
if not sw_cversion or not tversion:
print_result(title, MANUAL, 'Current and target Switch version not supplied. Skipping.')
return MANUAL

if sw_cversion.older_than("4.2(4d)") and tversion.newer_than("5.2(2d)"):
Expand Down

0 comments on commit 043fa78

Please sign in to comment.