Skip to content

Commit

Permalink
Use OID class to put . in front of number
Browse files Browse the repository at this point in the history
  • Loading branch information
stveit committed Nov 3, 2023
1 parent e4edf6a commit 0bc0136
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/nav/portadmin/snmp/cisco.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def set_poe_state(self, interface: manage.Interface, state: PoeState):
Available options should be retrieved using `get_poe_state_options`
"""
unit_number, interface_number = self._get_poe_indexes_for_interface(interface)
oid_with_unit_number = self.POEENABLE + f".{unit_number}"
oid_with_unit_number = self.POEENABLE + OID((unit_number,))
try:
self._set_netbox_value(

Check warning on line 337 in python/nav/portadmin/snmp/cisco.py

View check run for this annotation

Codecov / codecov/patch

python/nav/portadmin/snmp/cisco.py#L334-L337

Added lines #L334 - L337 were not covered by tests
oid_with_unit_number, interface_number, 'i', state.state
Expand Down Expand Up @@ -390,7 +390,7 @@ def _get_poe_state_for_single_interface(
) -> PoeState:
"""Retrieves current PoE state for given the given interface"""
unit_number, interface_number = self._get_poe_indexes_for_interface(interface)
oid_with_unit_number = self.POEENABLE + f".{unit_number}"
oid_with_unit_number = self.POEENABLE + OID((unit_number,))
state_value = self._query_netbox(oid_with_unit_number, interface_number)
if state_value == None:
raise POENotSupportedError("This interface does not support PoE")
Expand Down

0 comments on commit 0bc0136

Please sign in to comment.