Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Andrey Yemelyanov
noc
Commits
46857094
Commit
46857094
authored
Oct 04, 2018
by
Dmitry Lukhtionov
Browse files
Fix
parent
d8d934d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
sa/profiles/DLink/DxS/get_chassis_id.py
View file @
46857094
...
...
@@ -36,20 +36,20 @@ class Script(BaseScript):
# Do not use noc.sa.profiles.Generic.get_chassis_id
def
execute_snmp
(
self
):
macs
=
[]
macs
=
set
()
for
v
in
self
.
snmp
.
get
(
self
.
OIDS_CHECK
).
values
():
if
v
is
None
:
continue
mac
=
MAC
(
v
)
if
mac
==
"00:00:00:00:00:00"
or
mac
in
macs
:
continue
macs
+=
[
mac
]
macs
.
add
(
mac
)
for
oid
,
v
in
self
.
snmp
.
getnext
(
mib
[
"IF-MIB::ifPhysAddress"
]):
mac
=
MAC
(
v
)
if
mac
==
"00:00:00:00:00:00"
or
mac
in
macs
:
continue
macs
+=
[
mac
]
macs
.
sort
(
)
macs
.
add
(
mac
)
macs
=
sort
ed
(
macs
)
return
[{
"first_chassis_mac"
:
f
,
"last_chassis_mac"
:
t
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment