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
2ccc756a
Commit
2ccc756a
authored
10 months ago
by
Aleksandr Kurbatov
Browse files
Options
Downloads
Patches
Plain Diff
Update imports and formatting
parent
4c1603cf
No related branches found
No related tags found
No related merge requests found
Pipeline
#88990
passed
10 months ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
2
Pipelines
1
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 @
2ccc756a
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
import
json
import
json
from
typing
import
Any
from
typing
import
Any
from
gso.products.product_blocks
import
router
from
orchestrator
import
inputstep
,
step
from
orchestrator
import
inputstep
,
step
from
orchestrator.config.assignee
import
Assignee
from
orchestrator.config.assignee
import
Assignee
from
orchestrator.types
import
State
,
UUIDstr
from
orchestrator.types
import
State
,
UUIDstr
...
@@ -13,10 +12,13 @@ from pydantic_forms.core import FormPage
...
@@ -13,10 +12,13 @@ from pydantic_forms.core import FormPage
from
pydantic_forms.types
import
FormGenerator
from
pydantic_forms.types
import
FormGenerator
from
pydantic_forms.validators
import
Label
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.products.product_types.iptrunk
import
Iptrunk
from
gso.services
import
lso_client
from
gso.services
import
lso_client
from
gso.settings
import
load_oss_params
from
gso.settings
import
load_oss_params
from
gso.utils.helpers
import
generate_inventory_for_active_routers
from
gso.utils.helpers
import
generate_inventory_for_active_routers
from
gso.utils.shared_enums
import
Vendor
def
_deploy_base_config
(
def
_deploy_base_config
(
...
@@ -49,12 +51,11 @@ def _update_sdp_mesh(
...
@@ -49,12 +51,11 @@ def _update_sdp_mesh(
callback_route
:
str
,
callback_route
:
str
,
tt_number
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
process_id
:
UUIDstr
,
dry_run
:
bool
*
,
)
->
None
:
dry_run
:
bool
,
inventory
=
generate_inventory_for_active_routers
(
)
->
None
:
router_role
=
RouterRole
.
PE
,
inventory
=
generate_inventory_for_active_routers
(
router_vendor
=
Vendor
.
NOKIA
,
router_role
=
RouterRole
.
PE
,
router_vendor
=
Vendor
.
NOKIA
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
)
)
extra_vars
=
{
extra_vars
=
{
"
dry_run
"
:
dry_run
,
"
dry_run
"
:
dry_run
,
...
@@ -83,9 +84,10 @@ def _update_sdp_single_pe(
...
@@ -83,9 +84,10 @@ def _update_sdp_single_pe(
callback_route
:
str
,
callback_route
:
str
,
tt_number
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
process_id
:
UUIDstr
,
dry_run
:
bool
*
,
)
->
None
:
dry_run
:
bool
,
inventory
=
subscription
[
"
router
"
][
"
router_fqdn
"
]
)
->
None
:
inventory
=
subscription
[
"
router
"
][
"
router_fqdn
"
]
extra_vars
=
{
extra_vars
=
{
"
dry_run
"
:
dry_run
,
"
dry_run
"
:
dry_run
,
"
subscription
"
:
subscription
,
"
subscription
"
:
subscription
,
...
@@ -94,7 +96,7 @@ def _update_sdp_single_pe(
...
@@ -94,7 +96,7 @@ def _update_sdp_single_pe(
"
verb
"
:
"
update_sdp_mesh
"
,
"
verb
"
:
"
update_sdp_mesh
"
,
"
pe_router_list
"
:
generate_inventory_for_active_routers
(
"
pe_router_list
"
:
generate_inventory_for_active_routers
(
router
.
RouterRole
.
PE
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
router
.
RouterRole
.
PE
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
)
)
,
}
}
lso_client
.
execute_playbook
(
lso_client
.
execute_playbook
(
...
@@ -103,7 +105,7 @@ def _update_sdp_single_pe(
...
@@ -103,7 +105,7 @@ def _update_sdp_single_pe(
inventory
=
inventory
,
inventory
=
inventory
,
extra_vars
=
extra_vars
,
extra_vars
=
extra_vars
,
)
)
@step
(
"
[DRY RUN] Deploy base config
"
)
@step
(
"
[DRY RUN] Deploy base config
"
)
def
deploy_base_config_dry
(
def
deploy_base_config_dry
(
...
@@ -133,22 +135,17 @@ def deploy_base_config_real(
...
@@ -133,22 +135,17 @@ def deploy_base_config_real(
@step
(
"
[DRY RUN] Include new PE into SDP mesh on other Nokia PEs
"
)
@step
(
"
[DRY RUN] Include new PE into SDP mesh on other Nokia PEs
"
)
def
update_sdp_mesh_dry
(
def
update_sdp_mesh_dry
(
subscription
:
dict
[
str
,
Any
],
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
)
->
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
)
_update_sdp_mesh
(
subscription
,
tt_number
,
callback_route
,
process_id
,
dry_run
=
True
)
return
{
"
subscription
"
:
subscription
}
return
{
"
subscription
"
:
subscription
}
@step
(
"
[FOR REAL] Include new PE into SDP mesh on other Nokia PEs
"
)
@step
(
"
[FOR REAL] Include new PE into SDP mesh on other Nokia PEs
"
)
def
update_sdp_mesh_real
(
def
update_sdp_mesh_real
(
subscription
:
dict
[
str
,
Any
],
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
)
->
State
:
"""
Include new PE router in SDP mesh on other NOKIA PE routers.
"""
"""
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
)
_update_sdp_mesh
(
subscription
,
tt_number
,
callback_route
,
process_id
,
dry_run
=
False
)
...
@@ -158,12 +155,9 @@ def update_sdp_mesh_real(
...
@@ -158,12 +155,9 @@ def update_sdp_mesh_real(
@step
(
"
[DRY RUN] Configure SDP on a new PE to all other Nokia PEs
"
)
@step
(
"
[DRY RUN] Configure SDP on a new PE to all other Nokia PEs
"
)
def
update_sdp_single_pe_dry
(
def
update_sdp_single_pe_dry
(
subscription
:
dict
[
str
,
Any
],
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
)
->
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
)
_update_sdp_single_pe
(
subscription
,
tt_number
,
callback_route
,
process_id
,
dry_run
=
True
)
return
{
"
subscription
"
:
subscription
}
return
{
"
subscription
"
:
subscription
}
...
@@ -171,10 +165,7 @@ def update_sdp_single_pe_dry(
...
@@ -171,10 +165,7 @@ def update_sdp_single_pe_dry(
@step
(
"
[FOR REAL] Configure SDP on a new PE to all other Nokia PEs
"
)
@step
(
"
[FOR REAL] Configure SDP on a new PE to all other Nokia PEs
"
)
def
update_sdp_single_pe_real
(
def
update_sdp_single_pe_real
(
subscription
:
dict
[
str
,
Any
],
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
)
->
State
:
"""
Configure SDP on a new PE router to all other NOKIA PE routers.
"""
"""
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
)
_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 @
2ccc756a
...
@@ -29,6 +29,7 @@ from gso.utils.workflow_steps import (
...
@@ -29,6 +29,7 @@ from gso.utils.workflow_steps import (
update_sdp_mesh_real
,
update_sdp_mesh_real
,
)
)
def
initial_input_form_generator
(
subscription_id
:
UUIDstr
)
->
FormGenerator
:
def
initial_input_form_generator
(
subscription_id
:
UUIDstr
)
->
FormGenerator
:
"""
Promote P router to PE router.
"""
"""
Promote P router to PE router.
"""
subscription
=
Router
.
from_subscription
(
subscription_id
)
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