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
e0835db9
Commit
e0835db9
authored
1 year ago
by
root
Browse files
Options
Downloads
Patches
Plain Diff
Introducing is_ias_connected attribute and manage it in create_device
parent
ae49b5fd
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
#83805
failed
1 year ago
Stage: tox
Stage: documentation
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/device/create_device.py
+15
-11
15 additions, 11 deletions
gso/workflows/device/create_device.py
with
15 additions
and
11 deletions
gso/workflows/device/create_device.py
+
15
−
11
View file @
e0835db9
...
...
@@ -45,10 +45,10 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
device_site
:
site_selector
()
# type: ignore
hostname
:
str
ts_address
:
ipaddress
.
IPv4Address
ts_port
:
int
device_vendor
:
device_pb
.
DeviceVendor
device_role
:
device_pb
.
DeviceRole
is_ias_connected
:
bool
user_input
=
yield
CreateDeviceForm
...
...
@@ -73,22 +73,26 @@ def iso_from_ipv4(ipv4_address: ipaddress.IPv4Address) -> str:
@step
(
"
Get information from IPAM
"
)
def
get_info_from_ipam
(
subscription
:
DeviceProvisioning
)
->
State
:
def
get_info_from_ipam
(
subscription
:
DeviceProvisioning
,
is_ias_connected
:
bool
)
->
State
:
lo0_alias
=
re
.
sub
(
"
.geant.net
"
,
""
,
subscription
.
device
.
device_fqdn
)
lo0_name
=
f
"
lo0.
{
lo0_alias
}
"
lo0_addr
=
ipam
.
allocate_host
(
hostname
=
lo0_name
,
service_type
=
"
LO
"
,
cname_aliases
=
[
lo0_alias
])
subscription
.
device
.
device_lo_ipv4_address
=
lo0_addr
.
v4
subscription
.
device
.
device_lo_ipv6_address
=
lo0_addr
.
v6
subscription
.
device
.
device_lo_iso_address
=
iso_from_ipv4
(
subscription
.
device
.
device_lo_ipv4_address
)
subscription
.
device
.
device_si_ipv4_network
=
ipam
.
allocate_ipv4_network
(
service_type
=
"
SI
"
,
comment
=
f
"
SI for
{
lo0_name
}
"
).
v4
subscription
.
device
.
device_ias_lt_ipv4_network
=
ipam
.
allocate_ipv4_network
(
service_type
=
"
LT_IAS
"
,
comment
=
f
"
LT for
{
lo0_name
}
"
).
v4
subscription
.
device
.
device_ias_lt_ipv6_network
=
ipam
.
allocate_ipv6_network
(
service_type
=
"
LT_IAS
"
,
comment
=
f
"
LT for
{
lo0_name
}
"
).
v6
subscription
.
device
.
device_is_ias_connected
=
is_ias_connected
if
is_ias_connected
is
True
:
subscription
.
device
.
device_si_ipv4_network
=
ipam
.
allocate_ipv4_network
(
service_type
=
"
SI
"
,
comment
=
f
"
SI for
{
lo0_name
}
"
).
v4
subscription
.
device
.
device_ias_lt_ipv4_network
=
ipam
.
allocate_ipv4_network
(
service_type
=
"
LT_IAS
"
,
comment
=
f
"
LT for
{
lo0_name
}
"
).
v4
subscription
.
device
.
device_ias_lt_ipv6_network
=
ipam
.
allocate_ipv6_network
(
service_type
=
"
LT_IAS
"
,
comment
=
f
"
LT for
{
lo0_name
}
"
).
v6
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