Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
arthur-zzz
noc
Commits
1b5394ca
Verified
Commit
1b5394ca
authored
Jun 17, 2021
by
Andrey Vertiprahov
Browse files
NSN.TIMOS.get_lldp_neighbors. Rewrite fixme port function.
parent
b11dca86
Changes
1
Hide whitespace changes
Inline
Side-by-side
sa/profiles/NSN/TIMOS/get_lldp_neighbors.py
View file @
1b5394ca
...
...
@@ -60,21 +60,15 @@ class Script(BaseScript):
@
staticmethod
def
fixport
(
port
,
port_type
):
# fix alcatel encode port like hex string
remote_port
=
"u"
if
port_type
==
"5"
and
"
\n
"
in
port
:
remote_port
=
port
.
replace
(
"
\n
"
,
""
)
remote_port
=
remote_port
.
replace
(
":"
,
""
).
replace
(
"
\n
"
,
""
)
remote_port
=
smart_text
(
codecs
.
decode
(
remote_port
,
"hex"
))
elif
port_type
==
"5"
and
"
\n
"
in
port
:
remote_port
=
port
.
replace
(
"
\n
"
,
""
)
remote_port
=
remote_port
.
replace
(
":"
,
""
).
replace
(
"
\n
"
,
""
)
remote_port
=
smart_text
(
codecs
.
decode
(
remote_port
,
"hex"
))
elif
port_type
==
"5"
and
"
\n
"
not
in
port
:
remote_port
=
remote_port
.
replace
(
":"
,
""
).
replace
(
"
\n
"
,
""
)
remote_port
=
smart_text
(
codecs
.
decode
(
remote_port
,
"hex"
))
# PortId Subtype : 5 (interfaceName)
# Port Id : 65:73:61:74:2D:32:2F:31:2F:32:31
# "esat-2/1/21"
remote_port_name1
,
remote_port__name2
=
port
.
split
(
"
\n
"
,
1
)
return
smart_text
(
codecs
.
decode
(
remote_port_name1
.
strip
().
replace
(
":"
,
""
),
"hex"
))
elif
port_type
==
"7"
:
return
port
.
replace
(
"
\n
"
,
""
)
return
remote_
port
return
port
def
get_port_info
(
self
,
port
):
try
:
...
...
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