Skip to content

Commit a5549cb

Browse files
move psu key call to after kvm testbed check
1 parent 8e6fd7e commit a5549cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/snmp/test_snmp_psu.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def test_snmp_psu_status(duthosts, enum_supervisor_dut_hostname, localhost, cred
4545
localhost, host=hostip, version="v2c",
4646
community=creds_all_duts[duthost.hostname]["snmp_rocommunity"], wait=True)['ansible_facts']
4747

48-
psu_keys = natsorted(redis_get_keys(duthost, 'STATE_DB', 'PSU_INFO|*'))
4948
psus_on = 0
5049
msg = "Unexpected operstatus results {} != {} for PSU {}"
5150

@@ -54,6 +53,7 @@ def test_snmp_psu_status(duthosts, enum_supervisor_dut_hostname, localhost, cred
5453
logging.info("No snmp psu info on kvm testbed.")
5554
return
5655

56+
psu_keys = natsorted(redis_get_keys(duthost, 'STATE_DB', 'PSU_INFO|*'))
5757
for psu_indx, operstatus in snmp_facts['snmp_psu'].items():
5858
get_presence = duthost.shell(
5959
"redis-cli -n 6 hget '{}' presence".format(psu_keys[int(psu_indx)-1]))

0 commit comments

Comments
 (0)