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
ae49b5fd
Commit
ae49b5fd
authored
1 year ago
by
root
Browse files
Options
Downloads
Patches
Plain Diff
Add all the various conditions for terminating devices
parent
98299b68
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!56
Reworked devices and sites - added new attribute to manage local connection to IAS
Pipeline
#83804
failed
1 year ago
Stage: tox
Stage: documentation
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/workflows/device/terminate_device.py
+10
-4
10 additions, 4 deletions
gso/workflows/device/terminate_device.py
gso/workflows/site/create_site.py
+2
-2
2 additions, 2 deletions
gso/workflows/site/create_site.py
with
12 additions
and
6 deletions
gso/workflows/device/terminate_device.py
+
10
−
4
View file @
ae49b5fd
...
...
@@ -52,7 +52,7 @@ def deprovision_loopback_ips(subscription: Device) -> dict[str, HostAddresses]:
@step
(
"
Deprovision SI- interface IPs from IPAM/DNS
"
)
def
deprovision_si_ips
(
subscription
:
Device
)
->
dict
[
str
,
V4ServiceNetwork
|
V6ServiceNetwork
]:
service_network
=
ipam
.
delete_network
(
network
=
ipaddress
.
ip_network
(
subscription
.
device
.
device_si_ipv4_network
),
network
=
ipaddress
.
ip_network
(
subscription
.
device
.
device_si_ipv4_network
),
# type: ignore
service_type
=
"
SI
"
,
)
return
{
"
service_network
"
:
service_network
}
...
...
@@ -61,11 +61,11 @@ def deprovision_si_ips(subscription: Device) -> dict[str, V4ServiceNetwork | V6S
@step
(
"
Deprovision LT- interface (IAS) IPs from IPAM/DNS
"
)
def
deprovision_lt_ips
(
subscription
:
Device
)
->
dict
[
str
,
V4ServiceNetwork
|
V6ServiceNetwork
]:
service_network_v4
=
ipam
.
delete_network
(
network
=
ipaddress
.
ip_network
(
subscription
.
device
.
device_ias_lt_ipv4_network
),
network
=
ipaddress
.
ip_network
(
subscription
.
device
.
device_ias_lt_ipv4_network
),
# type: ignore
service_type
=
"
LT_IAS
"
,
)
service_network_v6
=
ipam
.
delete_network
(
network
=
ipaddress
.
ip_network
(
subscription
.
device
.
device_ias_lt_ipv6_network
),
network
=
ipaddress
.
ip_network
(
subscription
.
device
.
device_ias_lt_ipv6_network
),
# type: ignore
service_type
=
"
LT_IAS
"
,
)
return
{
...
...
@@ -87,8 +87,14 @@ def remove_config_from_device() -> None:
def
terminate_device
()
->
StepList
:
run_ipam_steps
=
conditional
(
lambda
state
:
state
.
get
(
"
clean_up_ipam
"
,
True
))
run_config_steps
=
conditional
(
lambda
state
:
state
.
get
(
"
remove_configuration
"
,
True
))
run_ias_removal
=
conditional
(
lambda
subscription
:
"
device_ias_lt_ipv4_network
"
in
subscription
.
get
(
"
device
"
,
{}))
run_si_removal
=
conditional
(
lambda
subscription
:
"
device_si_ipv4_network
"
in
subscription
.
get
(
"
device
"
,
{}))
ipam_steps
=
StepList
([
deprovision_loopback_ips
,
deprovision_si_ips
,
deprovision_lt_ips
])
ipam_steps
=
(
StepList
([
deprovision_loopback_ips
])
>>
run_si_removal
(
deprovision_si_ips
)
>>
run_ias_removal
(
deprovision_lt_ips
)
)
return
(
init
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/site/create_site.py
+
2
−
2
View file @
ae49b5fd
...
...
@@ -53,8 +53,8 @@ def initialize_subscription(
site_longitude
:
float
,
site_bgp_community_id
:
int
,
site_internal_id
:
int
,
site_tier
:
site_pb
.
SiteTier
,
site_ts_address
:
str
,
site_tier
:
site_pb
.
SiteTier
,
)
->
State
:
subscription
.
site
.
site_name
=
site_name
subscription
.
site
.
site_city
=
site_city
...
...
@@ -88,4 +88,4 @@ def create_site() -> StepList:
>>
set_status
(
SubscriptionLifecycle
.
ACTIVE
)
>>
resync
>>
done
site_tier
)
)
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