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
c0b3a841
Commit
c0b3a841
authored
3 months ago
by
Neda Moeini
Committed by
Mohammad Torkashvand
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Update create EdgePort WF
parent
28a66dea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!324
Feature/manage sid and gids
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/workflows/edge_port/create_edge_port.py
+2
-3
2 additions, 3 deletions
gso/workflows/edge_port/create_edge_port.py
test/workflows/edge_port/test_create_edge_port.py
+2
-3
2 additions, 3 deletions
test/workflows/edge_port/test_create_edge_port.py
with
4 additions
and
6 deletions
gso/workflows/edge_port/create_edge_port.py
+
2
−
3
View file @
c0b3a841
...
@@ -22,6 +22,7 @@ from gso.products.product_types.router import Router
...
@@ -22,6 +22,7 @@ from gso.products.product_types.router import Router
from
gso.services.lso_client
import
LSOState
,
lso_interaction
from
gso.services.lso_client
import
LSOState
,
lso_interaction
from
gso.services.netbox_client
import
NetboxClient
from
gso.services.netbox_client
import
NetboxClient
from
gso.services.partners
import
get_partner_by_id
from
gso.services.partners
import
get_partner_by_id
from
gso.services.subscriptions
import
make_unique_ga_id
from
gso.utils.helpers
import
(
from
gso.utils.helpers
import
(
active_pe_router_selector
,
active_pe_router_selector
,
available_interfaces_choices
,
available_interfaces_choices
,
...
@@ -52,7 +53,6 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
...
@@ -52,7 +53,6 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
minimum_links
:
int
minimum_links
:
int
mac_address
:
str
|
None
=
None
mac_address
:
str
|
None
=
None
ignore_if_down
:
bool
=
False
ignore_if_down
:
bool
=
False
ga_id
:
str
|
None
=
None
@model_validator
(
mode
=
"
after
"
)
@model_validator
(
mode
=
"
after
"
)
def
validate_number_of_members
(
self
)
->
Self
:
def
validate_number_of_members
(
self
)
->
Self
:
...
@@ -104,7 +104,6 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
...
@@ -104,7 +104,6 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
"
minimum_links
"
,
"
minimum_links
"
,
"
mac_address
"
,
"
mac_address
"
,
"
ignore_if_down
"
,
"
ignore_if_down
"
,
"
ga_id
"
,
"
enable_lacp
"
,
"
enable_lacp
"
,
"
edge_port_name
"
,
"
edge_port_name
"
,
"
edge_port_description
"
,
"
edge_port_description
"
,
...
@@ -134,7 +133,6 @@ def initialize_subscription(
...
@@ -134,7 +133,6 @@ def initialize_subscription(
encapsulation
:
EncapsulationType
,
encapsulation
:
EncapsulationType
,
name
:
str
,
name
:
str
,
minimum_links
:
int
,
minimum_links
:
int
,
ga_id
:
str
|
None
,
mac_address
:
str
|
None
,
mac_address
:
str
|
None
,
partner
:
str
,
partner
:
str
,
enable_lacp
:
bool
,
# noqa: FBT001
enable_lacp
:
bool
,
# noqa: FBT001
...
@@ -152,6 +150,7 @@ def initialize_subscription(
...
@@ -152,6 +150,7 @@ def initialize_subscription(
subscription
.
edge_port
.
edge_port_name
=
name
subscription
.
edge_port
.
edge_port_name
=
name
subscription
.
edge_port
.
minimum_links
=
minimum_links
subscription
.
edge_port
.
minimum_links
=
minimum_links
subscription
.
edge_port
.
ignore_if_down
=
ignore_if_down
subscription
.
edge_port
.
ignore_if_down
=
ignore_if_down
ga_id
=
make_unique_ga_id
()
subscription
.
edge_port
.
ga_id
=
ga_id
subscription
.
edge_port
.
ga_id
=
ga_id
subscription
.
edge_port
.
mac_address
=
mac_address
subscription
.
edge_port
.
mac_address
=
mac_address
partner_name
=
get_partner_by_id
(
partner
).
name
partner_name
=
get_partner_by_id
(
partner
).
name
...
...
This diff is collapsed.
Click to expand it.
test/workflows/edge_port/test_create_edge_port.py
+
2
−
3
View file @
c0b3a841
...
@@ -50,7 +50,6 @@ def input_form_wizard_data(request, router_subscription_factory, partner_factory
...
@@ -50,7 +50,6 @@ def input_form_wizard_data(request, router_subscription_factory, partner_factory
"
node
"
:
router_subscription_factory
(
vendor
=
Vendor
.
NOKIA
),
"
node
"
:
router_subscription_factory
(
vendor
=
Vendor
.
NOKIA
),
"
partner
"
:
partner_factory
(
name
=
"
GAAR
"
,
email
=
faker
.
email
())[
"
partner_id
"
],
"
partner
"
:
partner_factory
(
name
=
"
GAAR
"
,
email
=
faker
.
email
())[
"
partner_id
"
],
"
service_type
"
:
EdgePortType
.
PUBLIC
,
"
service_type
"
:
EdgePortType
.
PUBLIC
,
"
ga_id
"
:
faker
.
geant_gid
(),
"
enable_lacp
"
:
True
,
"
enable_lacp
"
:
True
,
"
speed
"
:
PhysicalPortCapacity
.
HUNDRED_GIGABIT_PER_SECOND
,
"
speed
"
:
PhysicalPortCapacity
.
HUNDRED_GIGABIT_PER_SECOND
,
"
encapsulation
"
:
EncapsulationType
.
DOT1Q
,
"
encapsulation
"
:
EncapsulationType
.
DOT1Q
,
...
@@ -101,9 +100,9 @@ def test_successful_edge_port_creation(
...
@@ -101,9 +100,9 @@ def test_successful_edge_port_creation(
subscription
=
EdgePort
.
from_subscription
(
subscription_id
)
subscription
=
EdgePort
.
from_subscription
(
subscription_id
)
assert
subscription
.
status
==
"
active
"
assert
subscription
.
status
==
"
active
"
ga_id
=
input_form_wizard_data
[
0
][
"
ga_id
"
]
router_fqdn
=
Router
.
from_subscription
(
input_form_wizard_data
[
0
][
"
node
"
]).
router
.
router_fqdn
router_fqdn
=
Router
.
from_subscription
(
input_form_wizard_data
[
0
][
"
node
"
]).
router
.
router_fqdn
assert
subscription
.
description
==
f
"
Edge Port lag-21 on
{
router_fqdn
}
, GAAR,
{
ga_id
}
"
assert
subscription
.
edge_port
.
ga_id
is
not
None
assert
subscription
.
description
==
f
"
Edge Port lag-21 on
{
router_fqdn
}
, GAAR,
{
subscription
.
edge_port
.
ga_id
}
"
assert
len
(
subscription
.
edge_port
.
edge_port_ae_members
)
==
2
assert
len
(
subscription
.
edge_port
.
edge_port_ae_members
)
==
2
assert
mock_execute_playbook
.
call_count
==
2
assert
mock_execute_playbook
.
call_count
==
2
...
...
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