Skip to content

Commit

Permalink
modify for sfp._port_num
Browse files Browse the repository at this point in the history
  • Loading branch information
laura-chang committed Mar 21, 2023
1 parent f3df7d8 commit 24d4370
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ def get_sfp_event(self, timeout=2000):
bitmap = 0
for sfp in self._sfp_list:
modpres = sfp.get_presence()
i=sfp.port_num-1
i=sfp._port_num-1
if modpres:
bitmap = bitmap | (1 << i)

changed_ports = self.sfp_change_event_data['present'] ^ bitmap
if changed_ports:
for sfp in self._sfp_list:
i=sfp.port_num-1
i=sfp._port_num-1
if (changed_ports & (1 << i)):
if (bitmap & (1 << i)) == 0:
port_dict[i+1] = '0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2202,7 +2202,7 @@ def get_position_in_parent(self):
Returns:
integer: The 1-based relative physical position in parent device or -1 if cannot determine the position
"""
return self.port_num
return self._port_num

def is_replaceable(self):
"""
Expand Down

0 comments on commit 24d4370

Please sign in to comment.