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
Merge requests
!314
Feature/vrf
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Feature/vrf
feature/vrf
into
develop
Overview
6
Commits
24
Pipelines
17
Changes
1
Merged
Neda Moeini
requested to merge
feature/vrf
into
develop
6 months ago
Overview
6
Commits
24
Pipelines
17
Changes
1
Expand
0
0
Merge request reports
Viewing commit
9b93e981
Show latest version
1 file
+
9
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
9b93e981
Add validation to modify VRF router list to avoid having duplicate routers in the VRF router list.
· 9b93e981
Neda Moeini
authored
6 months ago
gso/workflows/vrf/modify_vrf_router_list.py
+
9
−
1
Options
@@ -8,7 +8,7 @@ from orchestrator.types import FormGenerator, State, UUIDstr
from
orchestrator.workflow
import
StepList
,
begin
,
done
,
step
,
workflow
from
orchestrator.workflows.steps
import
resync
,
store_process_subscription
,
unsync
from
orchestrator.workflows.utils
import
wrap_modify_initial_input_form
from
pydantic
import
BaseModel
,
ConfigDict
,
Field
from
pydantic
import
BaseModel
,
ConfigDict
,
Field
,
field_validator
from
gso.products.product_types.router
import
Router
from
gso.products.product_types.vrf
import
VRF
@@ -35,6 +35,14 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
RouterSelection
(
router_id
=
str
(
router
.
owner_subscription_id
))
for
router
in
subscription
.
vrf
.
vrf_router_list
]
@field_validator
(
"
router_list
"
)
def
router_list_must_not_have_duplicates
(
cls
,
router_list
:
list
[
RouterSelection
])
->
list
[
RouterSelection
]:
router_ids
=
[
router
.
router_id
for
router
in
router_list
]
if
len
(
router_ids
)
!=
len
(
set
(
router_ids
)):
msg
=
"
Duplicate router IDs found in the list.
"
raise
ValueError
(
msg
)
return
router_list
user_input
=
yield
ModifyVRFRouterListForm
return
user_input
.
model_dump
()
Loading