Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Vladimir
noc
Commits
0aa7a36b
Commit
0aa7a36b
authored
Sep 03, 2020
by
Andrey Vertiprahov
Browse files
Merge branch 'cherry-pick-
7b2de7e5
' into 'release-20.3'
release-20.3:Backport!4272 See merge request
noc/noc!4273
parents
b172abfd
f13ac7f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
sa/profiles/Eltex/WOPLR/profile.py
View file @
0aa7a36b
...
...
@@ -2,11 +2,14 @@
# Vendor: Eltex
# OS: WOPLR
# ---------------------------------------------------------------------
# Copyright (C) 2007-20
19
The NOC Project
# Copyright (C) 2007-20
20
The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python modules
import
re
# NOC modules
from
noc.core.profile.base
import
BaseProfile
...
...
@@ -15,3 +18,14 @@ class Profile(BaseProfile):
pattern_prompt
=
r
"^(?P<hostname>\S+)\s*#|~ #"
command_exit
=
"exit"
pattern_syntax_error
=
r
"Invalid command\."
rx_physical
=
re
.
compile
(
r
"^(wlan|eth|br|tun|gre)\d+$"
)
@
classmethod
def
get_interface_type
(
cls
,
name
):
match
=
cls
.
rx_physical
.
match
(
name
)
if
match
and
match
.
group
(
1
)
in
{
"eth"
,
"wlan"
}:
return
"physical"
elif
match
and
match
.
group
(
1
)
in
{
"br"
,
"tun"
,
"gre"
}:
return
"SVI"
return
"other"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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