Skip to content
Snippets Groups Projects
Commit 20f96f60 authored by Neda Moeini's avatar Neda Moeini
Browse files

Update creat workflow for L2Circuit.

parent 77b923be
No related branches found
No related tags found
1 merge request!307Feature/l2circuits
......@@ -17,7 +17,7 @@ from pydantic_forms.validators import Divider, Label, ReadOnlyField
from gso.products.product_blocks.layer_2_circuit import Layer2CircuitSideBlockInactive, Layer2CircuitType
from gso.products.product_blocks.service_binding_port import ServiceBindingPortInactive
from gso.products.product_types.edge_port import EdgePort
from gso.products.product_types.layer_2_circuit import Layer2CircuitInactive
from gso.products.product_types.layer_2_circuit import Layer2Circuit, Layer2CircuitInactive
from gso.utils.helpers import active_edge_port_selector, generate_unique_vc_id, partner_choice
from gso.utils.shared_enums import SBPType
from gso.utils.types.interfaces import BandwidthString
......@@ -73,22 +73,6 @@ def initial_input_generator(product_name: str) -> FormGenerator:
side_divider: Divider = Field(None, exclude=True)
layer_2_circuit_side_b: Layer2CircuitSideSelection
def __init__(self, **data: Any):
"""Initialize fields based on user input conditions."""
super().__init__(**data)
if initial_user_input.layer_2_circuit_type == Layer2CircuitType.TAGGED:
self.vlan_range_label = Field("Please set a VLAN range, bounds including.", exclude=True)
self.vlan_range_lower_bound = VLAN_ID()
self.vlan_range_upper_bound = VLAN_ID()
else:
self.vlan_range_lower_bound = ReadOnlyField(None, default_type=int)
self.vlan_range_upper_bound = ReadOnlyField(None, default_type=int)
if initial_user_input.policer_enabled:
self.policer_bandwidth = BandwidthString()
else:
self.policer_bandwidth = ReadOnlyField(None, default_type=int)
layer_2_circuit_input = yield Layer2CircuitServiceSidesPage
return {"product_name": product_name} | initial_user_input.model_dump() | layer_2_circuit_input.model_dump()
......@@ -130,6 +114,8 @@ def initialize_subscription(
subscription.layer_2_circuit.policer_enabled = policer_enabled
subscription.layer_2_circuit.bandwidth = policer_bandwidth
subscription = Layer2Circuit.from_other_lifecycle(subscription, SubscriptionLifecycle.PROVISIONING)
return {"subscription": subscription}
......@@ -145,7 +131,7 @@ def create_layer_2_circuit() -> StepList:
>> create_subscription
>> store_process_subscription(Target.CREATE)
>> initialize_subscription
>> set_status(SubscriptionLifecycle.PROVISIONING)
>> set_status(SubscriptionLifecycle.ACTIVE)
>> resync
>> done
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment