Skip to content

Commit c60e159

Browse files
removing redundant call to mibs and use existing key
1 parent fe6ffdb commit c60e159

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/sonic_ax_impl/mibs/vendor/cisco/ciscoEntityFruControlMIB.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ def _get_psu_presence(self, psu_index):
7272
:return: the presence of particular PSU
7373
"""
7474
psu_keys = natsorted(self.statedb.keys(self.statedb.STATE_DB, "PSU_INFO|*"))
75-
psu_name = psu_keys[psu_index-1].removeprefix("PSU_INFO|")
76-
psu_info = self.statedb.get_all(self.statedb.STATE_DB, mibs.psu_info_table(psu_name))
75+
psu_info = self.statedb.get_all(self.statedb.STATE_DB, psu_keys[psu_index-1])
7776
presence, status = get_psu_data(psu_info)
7877

7978
return presence == PSU_PRESENCE_OK
@@ -84,8 +83,7 @@ def _get_psu_status(self, psu_index):
8483
:return: the status of particular PSU
8584
"""
8685
psu_keys = natsorted(self.statedb.keys(self.statedb.STATE_DB, "PSU_INFO|*"))
87-
psu_name = psu_keys[psu_index-1].removeprefix("PSU_INFO|")
88-
psu_info = self.statedb.get_all(self.statedb.STATE_DB, mibs.psu_info_table(psu_name))
86+
psu_info = self.statedb.get_all(self.statedb.STATE_DB, psu_keys[psu_index-1])
8987
presence, status = get_psu_data(psu_info)
9088

9189
return status == PSU_STATUS_OK

0 commit comments

Comments
 (0)