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
e31fef12
Commit
e31fef12
authored
1 year ago
by
JORGE SASIAIN
Committed by
Neda Moeini
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
NAT-244
: only interact with netbox for Nokia devices
parent
b9cbf3fc
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!94
Feature/Netbox integration terminate ip trunk
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/iptrunk/terminate_iptrunk.py
+17
-8
17 additions, 8 deletions
gso/workflows/iptrunk/terminate_iptrunk.py
with
17 additions
and
8 deletions
gso/workflows/iptrunk/terminate_iptrunk.py
+
17
−
8
View file @
e31fef12
...
...
@@ -8,6 +8,7 @@ from orchestrator.workflow import StepList, conditional, done, init, step, workf
from
orchestrator.workflows.steps
import
resync
,
set_status
,
store_process_subscription
,
unsync
from
orchestrator.workflows.utils
import
wrap_modify_initial_input_form
from
gso.products.product_blocks.router
import
RouterVendor
from
gso.products.product_types.iptrunk
import
Iptrunk
from
gso.services
import
infoblox
,
provisioning_proxy
from
gso.services.netbox_client
import
NetBoxClient
...
...
@@ -62,22 +63,30 @@ def deprovision_ip_trunk_real(subscription: Iptrunk, process_id: UUIDstr, tt_num
@step
(
"
Remove IP Trunk from NetBox
"
)
def
remove_iptrunk_from_netbox
(
subscription
:
Iptrunk
)
->
State
:
router_sideA
=
subscription
.
iptrunk
.
iptrunk_sides
[
0
].
iptrunk_side_node
.
router_fqdn
router_sideB
=
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_node
.
router_fqdn
_router_sideA
=
subscription
.
iptrunk
.
iptrunk_sides
[
0
].
iptrunk_side_node
_router_sideB
=
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_node
router_sideA
=
_router_sideA
.
router_fqdn
router_sideB
=
_router_sideB
.
router_fqdn
router_sideA_vendor
=
_router_sideA
.
router_vendor
router_sideB_vendor
=
_router_sideB
.
router_vendor
sideA_members
=
subscription
.
iptrunk
.
iptrunk_sides
[
0
].
iptrunk_side_ae_members
sideB_members
=
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_ae_members
sideA_ae_iface
=
subscription
.
iptrunk
.
iptrunk_sides
[
0
].
iptrunk_side_ae_iface
sideB_ae_iface
=
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_ae_iface
# Remove physical interfaces from LAGs
for
sideA_member
in
sideA_members
:
NetBoxClient
().
clear_interface
(
router_sideA
,
sideA_member
)
for
sideB_member
in
sideB_members
:
NetBoxClient
().
clear_interface
(
router_sideB
,
sideB_member
)
if
router_sideA_vendor
==
RouterVendor
.
NOKIA
:
for
sideA_member
in
sideA_members
:
NetBoxClient
().
clear_interface
(
router_sideA
,
sideA_member
)
if
router_sideB_vendor
==
RouterVendor
.
NOKIA
:
for
sideB_member
in
sideB_members
:
NetBoxClient
().
clear_interface
(
router_sideB
,
sideB_member
)
# Delete LAGs
NetBoxClient
().
delete_interface
(
router_sideA
,
sideA_ae_iface
)
NetBoxClient
().
delete_interface
(
router_sideB
,
sideB_ae_iface
)
if
router_sideA_vendor
==
RouterVendor
.
NOKIA
:
NetBoxClient
().
delete_interface
(
router_sideA
,
sideA_ae_iface
)
if
router_sideB_vendor
==
RouterVendor
.
NOKIA
:
NetBoxClient
().
delete_interface
(
router_sideB
,
sideB_ae_iface
)
return
{
"
subscription
"
:
subscription
}
...
...
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