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
83a56040
Verified
Commit
83a56040
authored
1 year ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
move create router workflow to new provisioning proxy endpoint
parent
03843a6b
No related branches found
No related tags found
1 merge request
!131
Move provisioning proxy steps to the new LSO endpoint
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/workflows/router/create_router.py
+4
-29
4 additions, 29 deletions
gso/workflows/router/create_router.py
test/workflows/router/test_create_router.py
+2
-2
2 additions, 2 deletions
test/workflows/router/test_create_router.py
with
6 additions
and
31 deletions
gso/workflows/router/create_router.py
+
4
−
29
View file @
83a56040
...
...
@@ -20,11 +20,12 @@ from gso.products.product_blocks.router import (
)
from
gso.products.product_types.router
import
RouterInactive
,
RouterProvisioning
from
gso.products.product_types.site
import
Site
from
gso.services
import
infoblox
,
provisioning_proxy
,
subscriptions
from
gso.services
import
infoblox
,
subscriptions
from
gso.services.crm
import
customer_selector
from
gso.services.netbox_client
import
NetboxClient
from
gso.services.provisioning_proxy
import
pp_interaction
from
gso.utils.helpers
import
iso_from_ipv4
from
gso.utils.workflow_steps
import
deploy_base_config_dry
,
deploy_base_config_real
def
_site_selector
()
->
Choice
:
...
...
@@ -123,32 +124,6 @@ def ipam_allocate_loopback(subscription: RouterProvisioning) -> State:
return
{
"
subscription
"
:
subscription
}
@step
(
"
Provision router [DRY RUN]
"
)
def
provision_router_dry
(
subscription
:
RouterProvisioning
,
process_id
:
UUIDstr
,
callback_route
:
str
,
tt_number
:
str
,
)
->
State
:
"""
Perform a dry run of deploying configuration on the router.
"""
provisioning_proxy
.
provision_router
(
subscription
,
process_id
,
callback_route
,
tt_number
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
Provision router [FOR REAL]
"
)
def
provision_router_real
(
subscription
:
RouterProvisioning
,
process_id
:
UUIDstr
,
callback_route
:
str
,
tt_number
:
str
,
)
->
State
:
"""
Deploy configuration on the router.
"""
provisioning_proxy
.
provision_router
(
subscription
,
process_id
,
callback_route
,
tt_number
,
dry_run
=
False
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
Create NetBox Device
"
)
def
create_netbox_device
(
subscription
:
RouterProvisioning
)
->
State
:
"""
Create a new device in Netbox.
...
...
@@ -194,8 +169,8 @@ def create_router() -> StepList:
>>
store_process_subscription
(
Target
.
CREATE
)
>>
initialize_subscription
>>
ipam_allocate_loopback
>>
pp_interaction
(
provision_router
_dry
)
>>
pp_interaction
(
provision_router
_real
)
>>
pp_interaction
(
deploy_base_config
_dry
)
>>
pp_interaction
(
deploy_base_config
_real
)
>>
verify_ipam_loopback
>>
create_netbox_device
>>
set_status
(
SubscriptionLifecycle
.
ACTIVE
)
...
...
This diff is collapsed.
Click to expand it.
test/workflows/router/test_create_router.py
+
2
−
2
View file @
83a56040
...
...
@@ -33,7 +33,7 @@ def router_creation_input_form_data(site_subscription_factory, faker):
@pytest.mark.workflow
()
@patch
(
"
gso.workflow
s.router.create_router.provisioning_proxy.provision_router
"
)
@patch
(
"
gso.
utils.
workflow
_steps.execute_playbook
"
)
@patch
(
"
gso.workflows.router.create_router.NetboxClient.create_device
"
)
@patch
(
"
gso.workflows.router.create_router.infoblox.hostname_available
"
)
@patch
(
"
gso.workflows.router.create_router.infoblox.find_host_by_fqdn
"
)
...
...
@@ -100,7 +100,7 @@ def test_create_nokia_router_success(
@pytest.mark.workflow
()
@patch
(
"
gso.workflow
s.router.create_router.provisioning_proxy.provision_router
"
)
@patch
(
"
gso.
utils.
workflow
_steps.execute_playbook
"
)
@patch
(
"
gso.workflows.router.create_router.NetboxClient.create_device
"
)
@patch
(
"
gso.workflows.router.create_router.infoblox.hostname_available
"
)
@patch
(
"
gso.workflows.router.create_router.infoblox.find_network_by_cidr
"
)
...
...
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