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
ae68be3b
Verified
Commit
ae68be3b
authored
1 year ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
update method name to prevent confusion
parent
ae0ba33f
No related branches found
No related tags found
1 merge request
!128
Feature/use conditionals
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/iptrunk/terminate_iptrunk.py
+7
-7
7 additions, 7 deletions
gso/workflows/iptrunk/terminate_iptrunk.py
with
7 additions
and
7 deletions
gso/workflows/iptrunk/terminate_iptrunk.py
+
7
−
7
View file @
ae68be3b
...
...
@@ -90,7 +90,7 @@ def deprovision_ip_trunk_real(subscription: Iptrunk, process_id: UUIDstr, callba
return
{
"
subscription
"
:
subscription
}
def
_re
move
_interface_from_netbox
(
side_block
:
IptrunkSideBlock
)
->
None
:
def
_
f
re
e_up
_interface
s
_from_netbox
(
side_block
:
IptrunkSideBlock
)
->
None
:
nbclient
=
NetboxClient
()
for
member
in
side_block
.
iptrunk_side_ae_members
:
...
...
@@ -101,17 +101,17 @@ def _remove_interface_from_netbox(side_block: IptrunkSideBlock) -> None:
@step
(
"
Netbox: Remove interfaces on side A
"
)
def
netbox_
remove_side_a_interfaces
(
subscription
:
Iptrunk
)
->
State
:
def
netbox_
clean_up_side_a
(
subscription
:
Iptrunk
)
->
State
:
"""
Mark used interfaces on side A as free in Netbox.
"""
_re
move
_interface_from_netbox
(
subscription
.
iptrunk
.
iptrunk_sides
[
0
])
_
f
re
e_up
_interface
s
_from_netbox
(
subscription
.
iptrunk
.
iptrunk_sides
[
0
])
return
{
"
subscription
"
:
subscription
}
@step
(
"
Netbox: Remove interfaces on side B
"
)
def
netbox_
remove_side_b_interfaces
(
subscription
:
Iptrunk
)
->
State
:
def
netbox_
clean_up_side_b
(
subscription
:
Iptrunk
)
->
State
:
"""
Mark used interfaces on side B as free in Netbox.
"""
_re
move
_interface_from_netbox
(
subscription
.
iptrunk
.
iptrunk_sides
[
1
])
_
f
re
e_up
_interface
s
_from_netbox
(
subscription
.
iptrunk
.
iptrunk_sides
[
1
])
return
{
"
subscription
"
:
subscription
}
...
...
@@ -177,8 +177,8 @@ def terminate_iptrunk() -> StepList:
>>
store_process_subscription
(
Target
.
TERMINATE
)
>>
unsync
>>
run_config_steps
(
config_steps
)
>>
side_a_is_nokia
(
netbox_
remove_side_a_interfaces
)
>>
side_b_is_nokia
(
netbox_
remove_side_b_interfaces
)
>>
side_a_is_nokia
(
netbox_
clean_up_side_a
)
>>
side_b_is_nokia
(
netbox_
clean_up_side_b
)
>>
run_ipam_steps
(
ipam_steps
)
>>
set_status
(
SubscriptionLifecycle
.
TERMINATED
)
>>
resync
...
...
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