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
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
9e588369
Verified
Commit
9e588369
authored
7 months ago
by
Neda Moeini
Committed by
Karel van Klink
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Improved promote P to PE workflow.
parent
f6caeb05
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gso/utils/helpers.py
+5
-1
5 additions, 1 deletion
gso/utils/helpers.py
gso/workflows/__init__.py
+1
-0
1 addition, 0 deletions
gso/workflows/__init__.py
gso/workflows/router/promote_p_to_pe.py
+225
-159
225 additions, 159 deletions
gso/workflows/router/promote_p_to_pe.py
with
231 additions
and
160 deletions
gso/utils/helpers.py
+
5
−
1
View file @
9e588369
...
...
@@ -306,6 +306,7 @@ def generate_fqdn(hostname: str, site_name: str, country_code: str) -> str:
def
generate_inventory_for_active_routers
(
router_role
:
RouterRole
,
exclude_routers
:
list
[
str
]
|
None
=
None
,
router_vendor
:
Vendor
|
None
=
None
,
)
->
dict
:
"""
Generate an Ansible-compatible inventory for executing playbooks.
...
...
@@ -313,6 +314,7 @@ def generate_inventory_for_active_routers(
:param RouterRole router_role: The role of the routers to include in the inventory.
:param list exclude_routers: List of routers to exclude from the inventory.
:param Vendor router_vendor: The vendor of the routers to include in the inventory.
:return: A dictionary representing the inventory of active routers.
:rtype: dict[str, Any]
"""
...
...
@@ -328,7 +330,9 @@ def generate_inventory_for_active_routers(
"
vendor
"
:
str
(
router
.
router
.
vendor
),
}
for
router
in
all_routers
if
router
.
router
.
router_role
==
router_role
and
router
.
router
.
router_fqdn
not
in
exclude_routers
if
router
.
router
.
router_role
==
router_role
and
router
.
router
.
router_fqdn
not
in
exclude_routers
and
(
router_vendor
is
None
or
router
.
router
.
vendor
==
router_vendor
)
}
}
}
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/__init__.py
+
1
−
0
View file @
9e588369
...
...
@@ -20,6 +20,7 @@ WF_USABLE_MAP.update({
"
terminate_site
"
:
ALL_ALIVE_STATES
,
"
terminate_router
"
:
ALL_ALIVE_STATES
,
"
terminate_iptrunk
"
:
ALL_ALIVE_STATES
,
"
promote_p_to_pe
"
:
[
SubscriptionLifecycle
.
ACTIVE
],
})
# IP trunk workflows
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/router/promote_p_to_pe.py
+
225
−
159
View file @
9e588369
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