Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for configuring PoE for cisco equipment #2635

Merged
merged 25 commits into from
Nov 15, 2023
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make poe options list static
stveit committed Nov 15, 2023
commit 98770594fd7ce4690cd21b8e79dbaa82eede7e79
15 changes: 8 additions & 7 deletions python/nav/portadmin/snmp/cisco.py
Original file line number Diff line number Diff line change
@@ -72,6 +72,13 @@ class Cisco(SNMPHandler):
POE_LIMIT = PoeState(state=3, name="LIMIT")
POE_DISABLE = PoeState(state=4, name="DISABLE")

POE_OPTIONS = [
POE_AUTO,
POE_STATIC,
POE_LIMIT,
POE_DISABLE,
]

def __init__(self, netbox, **kwargs):
super(Cisco, self).__init__(netbox, **kwargs)
self.vlan_oid = '1.3.6.1.4.1.9.9.68.1.2.2.1.2'
@@ -317,13 +324,7 @@ def get_dot1x_enabled_interfaces(self):

def get_poe_state_options(self) -> Sequence[PoeState]:
"""Returns the available options for enabling/disabling PoE on this netbox"""
options_list = [
self.POE_AUTO,
self.POE_STATIC,
self.POE_LIMIT,
self.POE_DISABLE,
]
return options_list
return self.POE_OPTIONS

@translate_protocol_errors
def set_poe_state(self, interface: manage.Interface, state: PoeState):