Skip to content
Snippets Groups Projects
Verified Commit b74b3279 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Make router creation workflow use helper method

parent 82f445fa
Branches
Tags 1.1.75
1 merge request!286Add Edge Port, GÉANT IP and IAS products
This commit is part of merge request !286. Comments created here will be created in the context of that merge request.
...@@ -4,7 +4,7 @@ from typing import Self ...@@ -4,7 +4,7 @@ from typing import Self
from orchestrator.config.assignee import Assignee from orchestrator.config.assignee import Assignee
from orchestrator.forms import FormPage from orchestrator.forms import FormPage
from orchestrator.forms.validators import Choice, Label from orchestrator.forms.validators import Label
from orchestrator.targets import Target from orchestrator.targets import Target
from orchestrator.types import FormGenerator, State, SubscriptionLifecycle, UUIDstr from orchestrator.types import FormGenerator, State, SubscriptionLifecycle, UUIDstr
from orchestrator.utils.errors import ProcessFailureError from orchestrator.utils.errors import ProcessFailureError
...@@ -17,13 +17,13 @@ from pydantic_forms.validators import ReadOnlyField ...@@ -17,13 +17,13 @@ from pydantic_forms.validators import ReadOnlyField
from gso.products.product_blocks.router import RouterRole from gso.products.product_blocks.router import RouterRole
from gso.products.product_types.router import RouterInactive, RouterProvisioning from gso.products.product_types.router import RouterInactive, RouterProvisioning
from gso.products.product_types.site import Site from gso.products.product_types.site import Site
from gso.services import infoblox, subscriptions from gso.services import infoblox
from gso.services.lso_client import lso_interaction from gso.services.lso_client import lso_interaction
from gso.services.netbox_client import NetboxClient from gso.services.netbox_client import NetboxClient
from gso.services.partners import get_partner_by_name from gso.services.partners import get_partner_by_name
from gso.services.sharepoint import SharePointClient from gso.services.sharepoint import SharePointClient
from gso.settings import load_oss_params from gso.settings import load_oss_params
from gso.utils.helpers import generate_fqdn, iso_from_ipv4 from gso.utils.helpers import active_site_selector, generate_fqdn, iso_from_ipv4
from gso.utils.shared_enums import Vendor from gso.utils.shared_enums import Vendor
from gso.utils.types.ip_address import PortNumber from gso.utils.types.ip_address import PortNumber
from gso.utils.types.tt_number import TTNumber from gso.utils.types.tt_number import TTNumber
...@@ -35,15 +35,6 @@ from gso.utils.workflow_steps import ( ...@@ -35,15 +35,6 @@ from gso.utils.workflow_steps import (
) )
def _site_selector() -> Choice:
site_subscriptions = {}
for site in subscriptions.get_active_site_subscriptions(includes=["subscription_id", "description"]):
site_subscriptions[str(site["subscription_id"])] = site["description"]
# noinspection PyTypeChecker
return Choice("Select a site", zip(site_subscriptions.keys(), site_subscriptions.items(), strict=True)) # type: ignore[arg-type]
def initial_input_form_generator(product_name: str) -> FormGenerator: def initial_input_form_generator(product_name: str) -> FormGenerator:
"""Gather information about the new router from the operator.""" """Gather information about the new router from the operator."""
...@@ -53,7 +44,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: ...@@ -53,7 +44,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
tt_number: TTNumber tt_number: TTNumber
partner: ReadOnlyField("GEANT", default_type=str) # type: ignore[valid-type] partner: ReadOnlyField("GEANT", default_type=str) # type: ignore[valid-type]
vendor: Vendor vendor: Vendor
router_site: _site_selector() # type: ignore[valid-type] router_site: active_site_selector()
hostname: str hostname: str
ts_port: PortNumber ts_port: PortNumber
router_role: RouterRole router_role: RouterRole
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment