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
f71c9abb
Commit
f71c9abb
authored
9 months ago
by
Aleksandr Kurbatov
Committed by
Aleksandr Kurbatov
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Update imports and formatting
parent
03d0fcda
No related branches found
No related tags found
1 merge request
!267
SDP mesh functions
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/utils/workflow_steps.py
+21
-30
21 additions, 30 deletions
gso/utils/workflow_steps.py
gso/workflows/router/promote_p_to_pe.py
+1
-0
1 addition, 0 deletions
gso/workflows/router/promote_p_to_pe.py
with
22 additions
and
30 deletions
gso/utils/workflow_steps.py
+
21
−
30
View file @
f71c9abb
...
...
@@ -3,7 +3,6 @@
import
json
from
typing
import
Any
from
gso.products.product_blocks
import
router
from
orchestrator
import
inputstep
,
step
from
orchestrator.config.assignee
import
Assignee
from
orchestrator.types
import
State
,
UUIDstr
...
...
@@ -13,10 +12,13 @@ from pydantic_forms.core import FormPage
from
pydantic_forms.types
import
FormGenerator
from
pydantic_forms.validators
import
Label
from
gso.products.product_blocks
import
router
from
gso.products.product_blocks.router
import
RouterRole
from
gso.products.product_types.iptrunk
import
Iptrunk
from
gso.services
import
lso_client
from
gso.settings
import
load_oss_params
from
gso.utils.helpers
import
generate_inventory_for_active_routers
from
gso.utils.shared_enums
import
Vendor
def
_deploy_base_config
(
...
...
@@ -49,12 +51,11 @@ def _update_sdp_mesh(
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
dry_run
:
bool
)
->
None
:
inventory
=
generate_inventory_for_active_routers
(
router_role
=
RouterRole
.
PE
,
router_vendor
=
Vendor
.
NOKIA
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
*
,
dry_run
:
bool
,
)
->
None
:
inventory
=
generate_inventory_for_active_routers
(
router_role
=
RouterRole
.
PE
,
router_vendor
=
Vendor
.
NOKIA
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
)
extra_vars
=
{
"
dry_run
"
:
dry_run
,
...
...
@@ -83,9 +84,10 @@ def _update_sdp_single_pe(
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
dry_run
:
bool
)
->
None
:
inventory
=
subscription
[
"
router
"
][
"
router_fqdn
"
]
*
,
dry_run
:
bool
,
)
->
None
:
inventory
=
subscription
[
"
router
"
][
"
router_fqdn
"
]
extra_vars
=
{
"
dry_run
"
:
dry_run
,
"
subscription
"
:
subscription
,
...
...
@@ -94,7 +96,7 @@ def _update_sdp_single_pe(
"
verb
"
:
"
update_sdp_mesh
"
,
"
pe_router_list
"
:
generate_inventory_for_active_routers
(
router
.
RouterRole
.
PE
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
)
)
,
}
lso_client
.
execute_playbook
(
...
...
@@ -103,7 +105,7 @@ def _update_sdp_single_pe(
inventory
=
inventory
,
extra_vars
=
extra_vars
,
)
@step
(
"
[DRY RUN] Deploy base config
"
)
def
deploy_base_config_dry
(
...
...
@@ -133,22 +135,17 @@ def deploy_base_config_real(
@step
(
"
[DRY RUN] Include new PE into SDP mesh on other Nokia PEs
"
)
def
update_sdp_mesh_dry
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
"""
Perform a dry run of including new PE router in SDP mesh on other NOKIA PE routers
"""
"""
Perform a dry run of including new PE router in SDP mesh on other NOKIA PE routers
.
"""
_update_sdp_mesh
(
subscription
,
tt_number
,
callback_route
,
process_id
,
dry_run
=
True
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
[FOR REAL] Include new PE into SDP mesh on other Nokia PEs
"
)
def
update_sdp_mesh_real
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
"""
Include new PE router in SDP mesh on other NOKIA PE routers.
"""
_update_sdp_mesh
(
subscription
,
tt_number
,
callback_route
,
process_id
,
dry_run
=
False
)
...
...
@@ -158,12 +155,9 @@ def update_sdp_mesh_real(
@step
(
"
[DRY RUN] Configure SDP on a new PE to all other Nokia PEs
"
)
def
update_sdp_single_pe_dry
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
"""
Perform a dry run of configuring SDP on a new PE router to all other NOKIA PE routers
"""
"""
Perform a dry run of configuring SDP on a new PE router to all other NOKIA PE routers
.
"""
_update_sdp_single_pe
(
subscription
,
tt_number
,
callback_route
,
process_id
,
dry_run
=
True
)
return
{
"
subscription
"
:
subscription
}
...
...
@@ -171,10 +165,7 @@ def update_sdp_single_pe_dry(
@step
(
"
[FOR REAL] Configure SDP on a new PE to all other Nokia PEs
"
)
def
update_sdp_single_pe_real
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
"""
Configure SDP on a new PE router to all other NOKIA PE routers.
"""
_update_sdp_single_pe
(
subscription
,
tt_number
,
callback_route
,
process_id
,
dry_run
=
False
)
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/router/promote_p_to_pe.py
+
1
−
0
View file @
f71c9abb
...
...
@@ -29,6 +29,7 @@ from gso.utils.workflow_steps import (
update_sdp_mesh_real
,
)
def
initial_input_form_generator
(
subscription_id
:
UUIDstr
)
->
FormGenerator
:
"""
Promote P router to PE router.
"""
subscription
=
Router
.
from_subscription
(
subscription_id
)
...
...
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