Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
noc
noc
Commits
243868e4
Verified
Commit
243868e4
authored
Aug 22, 2022
by
Andrey Vertiprahov
Browse files
Zyxel.MSAN.get_interfaces. Fix slot count in range.
parent
5d1af19c
Pipeline
#37302
passed with stages
in 14 minutes and 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
sa/profiles/Zyxel/MSAN/get_interfaces.py
View file @
243868e4
...
...
@@ -93,7 +93,7 @@ class Script(BaseScript):
r
+=
[
match
.
group
(
"port"
)]
return
r
def
execute
(
self
):
def
execute
_cli
(
self
):
slots
=
self
.
profile
.
get_slots_n
(
self
)
interfaces
=
[]
iface_mac
=
[]
...
...
@@ -155,6 +155,7 @@ class Script(BaseScript):
"type"
:
"physical"
,
"admin_status"
:
admin_status
,
"oper_status"
:
oper_status
,
"hints"
:
[
"noc::topology::direction::nni"
,
"technology::ethernet::1000base"
],
"enabled_protocols"
:
[],
"subinterfaces"
:
[
{
...
...
@@ -174,7 +175,7 @@ class Script(BaseScript):
interfaces
+=
[
iface
]
port_num
+=
1
port_show
=
True
for
i
in
range
(
1
,
slots
):
for
i
in
range
(
1
,
slots
+
1
):
if
port_show
:
try
:
v
=
self
.
cli
(
"port show %s"
%
i
)
...
...
@@ -278,6 +279,10 @@ class Script(BaseScript):
tagged
+=
[
v
[
"vid"
]]
iface
=
{
"name"
:
ifname
,
"type"
:
"physical"
,
"subinterfaces"
:
[]}
if
ifname
.
startswith
(
"Enet"
):
iface
[
"hints"
]
=
[
"noc::topology::direction::nni"
,
"technology::ethernet::1000base"
,
]
iface
[
"subinterfaces"
]
+=
[{
"name"
:
ifname
,
"enabled_afi"
:
[
"BRIDGE"
]}]
if
untagged
:
iface
[
"subinterfaces"
][
0
][
"untagged_vlan"
]
=
untagged
...
...
@@ -324,6 +329,10 @@ class Script(BaseScript):
continue
sub
[
"tagged_vlans"
]
+=
[
vid
]
iface
[
"subinterfaces"
]
+=
[
sub
]
iface
[
"hints"
]
=
[
"noc::topology::direction::nni"
,
"technology::ethernet::1000base"
,
]
interfaces
+=
[
iface
]
if
ifname
.
startswith
(
"adsl"
):
for
match
in
self
.
rx_sub_o2
.
finditer
(
adsl
):
...
...
@@ -344,6 +353,7 @@ class Script(BaseScript):
"vci"
:
int
(
match
.
group
(
"vci"
)),
}
]
iface
[
"hints"
]
=
[
"technology::dsl::adsl"
]
interfaces
+=
[
iface
]
if
ifname
.
startswith
(
"gshdsl"
):
for
match
in
self
.
rx_sub_o3
.
finditer
(
adsl
):
...
...
@@ -370,6 +380,7 @@ class Script(BaseScript):
sub
[
"vlan_ids"
]
=
int
(
match
.
group
(
"pvid"
))
elif
vid
!=
1
:
sub
[
"vlan_ids"
]
=
int
(
vid
)
iface
[
"hints"
]
=
[
"technology::dsl::shdsl"
]
iface
[
"subinterfaces"
]
=
[
sub
]
interfaces
+=
[
iface
]
c
=
self
.
cli
(
"ip device list"
)
...
...
Andrey Vertiprahov
@aversant
mentioned in commit
f52f77ba
·
Aug 22, 2022
mentioned in commit
f52f77ba
mentioned in commit f52f77ba4a542251b3aef6e4ac31e6fa2a2f981b
Toggle commit list
Andrey Vertiprahov
@aversant
mentioned in merge request
!6605 (merged)
·
Aug 22, 2022
mentioned in merge request
!6605 (merged)
mentioned in merge request !6605
Toggle commit list
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