Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
1beb5eeb
Commit
1beb5eeb
authored
1 year ago
by
Hakan Calim
Committed by
Neda Moeini
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
NAT-329
: fixed iteration over LAGMember list
parent
85efbaf9
No related branches found
No related tags found
1 merge request
!122
Feature/nat 329 interface names should validated 3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/utils/helpers.py
+5
-8
5 additions, 8 deletions
gso/utils/helpers.py
with
5 additions
and
8 deletions
gso/utils/helpers.py
+
5
−
8
View file @
1beb5eeb
...
@@ -279,15 +279,12 @@ def validate_interface_name_list(interface_name_list: list) -> list:
...
@@ -279,15 +279,12 @@ def validate_interface_name_list(interface_name_list: list) -> list:
Returns:
Returns:
-------
-------
list: The list of interface names if all match was successfull.
list: The list of interface names if all match was successful, otherwise it will throw a ValueError exception.
Otherwise it will throw a ValueError exception.
"""
"""
pattern
=
re
.
compile
(
r
"
^(ge|et|xe)-[0-9]/[0-9]/[0-9]$
"
)
pattern
=
re
.
compile
(
r
"
^(ge|et|xe)-[0-9]/[0-9]/[0-9]$
"
)
for
interface
_name
in
interface_name_list
:
for
interface
in
interface_name_list
:
if
not
bool
(
pattern
.
match
(
interface_name
)):
if
not
bool
(
pattern
.
match
(
interface
.
interface
_name
)):
error_msg
=
(
raise
ValueError
(
f
"
Invalid interface name. The interface name should be of format:
"
f
"
Invalid interface name. The interface name should be of format:
"
f
"
xe-1/0/0. Got: [
{
interface_name
}
]
"
)
f
"
xe-1/0/0. Got: [
{
interface
.
interface_name
}
]
"
)
raise
ValueError
(
error_msg
)
return
interface_name_list
return
interface_name_list
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment