diff --git a/gso/workflows/iptrunk/activate_iptrunk.py b/gso/workflows/iptrunk/activate_iptrunk.py index a98a0446c50a4de14b8f55502b633babb7d027af..f229599f516df9ee59f09834be7de38800dc841c 100644 --- a/gso/workflows/iptrunk/activate_iptrunk.py +++ b/gso/workflows/iptrunk/activate_iptrunk.py @@ -5,7 +5,7 @@ from orchestrator.forms import FormPage from orchestrator.forms.validators import Label from orchestrator.targets import Target from orchestrator.types import FormGenerator, SubscriptionLifecycle, UUIDstr -from orchestrator.workflow import StepList, done, init, inputstep, workflow +from orchestrator.workflow import StepList, begin, done, inputstep, workflow from orchestrator.workflows.steps import resync, set_status, store_process_subscription, unsync from orchestrator.workflows.utils import wrap_modify_initial_input_form @@ -49,7 +49,7 @@ def activate_iptrunk() -> StepList: * Update the subscription lifecycle state to ``ACTIVE``. """ return ( - init + begin >> store_process_subscription(Target.MODIFY) >> unsync >> verify_complete_checklist diff --git a/gso/workflows/iptrunk/create_imported_iptrunk.py b/gso/workflows/iptrunk/create_imported_iptrunk.py index bd2ea9876dfd943ea089257be71f41dd7985ec51..dd5ceed0eee93d5e44401a12b72f094ce77765f6 100644 --- a/gso/workflows/iptrunk/create_imported_iptrunk.py +++ b/gso/workflows/iptrunk/create_imported_iptrunk.py @@ -9,7 +9,7 @@ from orchestrator.forms import FormPage from orchestrator.forms.validators import Choice from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, SubscriptionLifecycle -from orchestrator.workflow import StepList, done, init, step +from orchestrator.workflow import StepList, begin, done, step from orchestrator.workflows.steps import resync, set_status, store_process_subscription from pydantic import AfterValidator, ConfigDict from pydantic_forms.validators import validate_unique_list @@ -152,7 +152,7 @@ def update_ipam_stub_for_subscription( def create_imported_iptrunk() -> StepList: """Import an IP trunk without provisioning it.""" return ( - init + begin >> create_subscription >> store_process_subscription(Target.CREATE) >> initialize_subscription diff --git a/gso/workflows/iptrunk/create_iptrunk.py b/gso/workflows/iptrunk/create_iptrunk.py index 30f2c46b172707fa905055339db060e57f81f440..ae5a143248d7c381cdfd37fbf80ab5bb0b1bcca9 100644 --- a/gso/workflows/iptrunk/create_iptrunk.py +++ b/gso/workflows/iptrunk/create_iptrunk.py @@ -530,7 +530,7 @@ def create_iptrunk() -> StepList: side_b_is_nokia = conditional(lambda state: get_router_vendor(state["side_b_node_id"]) == Vendor.NOKIA) return ( - init + begin >> create_subscription >> store_process_subscription(Target.CREATE) >> initialize_subscription diff --git a/gso/workflows/iptrunk/deploy_twamp.py b/gso/workflows/iptrunk/deploy_twamp.py index 10970127b924e34d749bfe68685bac48c048374c..60e852cc0c88079782d5908ffaf2b98da76be18f 100644 --- a/gso/workflows/iptrunk/deploy_twamp.py +++ b/gso/workflows/iptrunk/deploy_twamp.py @@ -7,7 +7,7 @@ from orchestrator.forms.validators import Label from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, UUIDstr from orchestrator.utils.json import json_dumps -from orchestrator.workflow import StepList, done, init, step, workflow +from orchestrator.workflow import StepList, begin, done, step, workflow from orchestrator.workflows.steps import resync, store_process_subscription, unsync from orchestrator.workflows.utils import wrap_modify_initial_input_form from pydantic import field_validator @@ -108,7 +108,7 @@ def deploy_twamp() -> StepList: * Run the :term:`TWAMP` playbook, including an initial dry run """ return ( - init + begin >> store_process_subscription(Target.MODIFY) >> unsync >> lso_interaction(deploy_twamp_dry) diff --git a/gso/workflows/iptrunk/migrate_iptrunk.py b/gso/workflows/iptrunk/migrate_iptrunk.py index b0dfb950b838cddd11eb9b754e4aa3d7fa2b4270..913d78364087697b9d20b6df47ca7db5f28dcd03 100644 --- a/gso/workflows/iptrunk/migrate_iptrunk.py +++ b/gso/workflows/iptrunk/migrate_iptrunk.py @@ -18,7 +18,7 @@ from orchestrator.forms.validators import Choice, Label from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, UUIDstr from orchestrator.utils.json import json_dumps -from orchestrator.workflow import StepList, conditional, done, init, inputstep +from orchestrator.workflow import StepList, begin, conditional, done, inputstep from orchestrator.workflows.steps import resync, store_process_subscription, unsync from orchestrator.workflows.utils import wrap_modify_initial_input_form from pydantic import AfterValidator, ConfigDict, field_validator @@ -843,7 +843,7 @@ def migrate_iptrunk() -> StepList: ) return ( - init + begin >> store_process_subscription(Target.MODIFY) >> unsync >> new_side_is_nokia(netbox_reserve_interfaces) diff --git a/gso/workflows/iptrunk/modify_isis_metric.py b/gso/workflows/iptrunk/modify_isis_metric.py index 4e8332aa5d00c4abe7e3b41992e4b440273a437a..ed38b1be9f137021367aa6e29149e2c82ab9b01a 100644 --- a/gso/workflows/iptrunk/modify_isis_metric.py +++ b/gso/workflows/iptrunk/modify_isis_metric.py @@ -6,7 +6,7 @@ from orchestrator.forms import FormPage from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, UUIDstr from orchestrator.utils.json import json_dumps -from orchestrator.workflow import StepList, done, init, step, workflow +from orchestrator.workflow import StepList, begin, done, step, workflow from orchestrator.workflows.steps import resync, store_process_subscription, unsync from orchestrator.workflows.utils import wrap_modify_initial_input_form @@ -104,7 +104,7 @@ def modify_isis_metric() -> StepList: * Deploy the new :term:`ISIS` metric on both sides of the trunk """ return ( - init + begin >> store_process_subscription(Target.MODIFY) >> unsync >> modify_iptrunk_subscription diff --git a/gso/workflows/iptrunk/modify_trunk_interface.py b/gso/workflows/iptrunk/modify_trunk_interface.py index 92f71d6df5d7c8dde4f34fdb04925857f27e7512..b8f272a6106395ef4e784eba099bc1028c3faad6 100644 --- a/gso/workflows/iptrunk/modify_trunk_interface.py +++ b/gso/workflows/iptrunk/modify_trunk_interface.py @@ -9,7 +9,7 @@ from orchestrator.forms import FormPage from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, UUIDstr from orchestrator.utils.json import json_dumps -from orchestrator.workflow import StepList, conditional, done, init, step, workflow +from orchestrator.workflow import StepList, begin, conditional, done, step, workflow from orchestrator.workflows.steps import resync, store_process_subscription, unsync from orchestrator.workflows.utils import wrap_modify_initial_input_form from pydantic import AfterValidator, ConfigDict, field_validator @@ -418,7 +418,7 @@ def modify_trunk_interface() -> StepList: == Vendor.NOKIA ) return ( - init + begin >> store_process_subscription(Target.MODIFY) >> unsync >> modify_iptrunk_subscription diff --git a/gso/workflows/iptrunk/terminate_iptrunk.py b/gso/workflows/iptrunk/terminate_iptrunk.py index 1ae61b80cd486d46f0f0fbea139868b01dc96d15..0c8a2726526b2619699aa4bb240cf25f10bc51be 100644 --- a/gso/workflows/iptrunk/terminate_iptrunk.py +++ b/gso/workflows/iptrunk/terminate_iptrunk.py @@ -8,7 +8,7 @@ from orchestrator.forms.validators import Label from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, SubscriptionLifecycle, UUIDstr from orchestrator.utils.json import json_dumps -from orchestrator.workflow import StepList, conditional, done, init, step, workflow +from orchestrator.workflow import StepList, begin, conditional, done, step, workflow from orchestrator.workflows.steps import ( resync, set_status, @@ -172,14 +172,14 @@ def terminate_iptrunk() -> StepList: ) config_steps = ( - init + begin >> lso_interaction(set_isis_to_max) >> lso_interaction(deprovision_ip_trunk_dry) >> lso_interaction(deprovision_ip_trunk_real) ) return ( - init + begin >> store_process_subscription(Target.TERMINATE) >> unsync >> run_config_steps(config_steps) diff --git a/gso/workflows/iptrunk/validate_iptrunk.py b/gso/workflows/iptrunk/validate_iptrunk.py index 45e26d3e6feb0355e2c4acfa4a1fb030ce70c4cb..c07153701eb6d7fd63a08ea6f24e042e4ac15136 100644 --- a/gso/workflows/iptrunk/validate_iptrunk.py +++ b/gso/workflows/iptrunk/validate_iptrunk.py @@ -5,13 +5,10 @@ import json from orchestrator.targets import Target from orchestrator.utils.errors import ProcessFailureError from orchestrator.utils.json import json_dumps -from orchestrator.workflow import StepList, done, init, step, workflow +from orchestrator.workflow import StepList, begin, done, step, workflow from orchestrator.workflows.steps import resync, store_process_subscription, unsync from orchestrator.workflows.utils import wrap_modify_initial_input_form from services.netbox_client import NetboxClient -from workflows.iptrunk.deploy_twamp import deploy_twamp_dry -from workflows.iptrunk.migrate_iptrunk import check_ip_trunk_isis -from workflows.iptrunk.modify_trunk_interface import provision_ip_trunk_iface_dry from gso.products.product_types.iptrunk import Iptrunk from gso.services import infoblox @@ -19,6 +16,9 @@ from gso.services.lso_client import anonymous_lso_interaction, execute_playbook from gso.utils.helpers import get_router_vendor from gso.utils.shared_enums import Vendor from gso.utils.workflow_steps import detect_configuration_drift +from gso.workflows.iptrunk.deploy_twamp import deploy_twamp_dry +from gso.workflows.iptrunk.migrate_iptrunk import check_ip_trunk_isis +from gso.workflows.iptrunk.modify_trunk_interface import provision_ip_trunk_iface_dry @step("Validate IP trunk configuration") @@ -49,8 +49,8 @@ def verify_ipam_records(subscription: Iptrunk) -> None: ipam_errors += [ ( "Missing IP trunk IPAM records, found the following instead.\n" - f"IPv4 expected '{subscription.iptrunk.iptrunk_ipv4_network}', actual: '{ipam_v4_network.network}'\n" - f"IPv6 expected '{subscription.iptrunk.iptrunk_ipv6_network}', actual: '{ipam_v6_network.network}'" + f"IPv4 expected '{subscription.iptrunk.iptrunk_ipv4_network}', actual: '{ipam_v4_network}'\n" + f"IPv6 expected '{subscription.iptrunk.iptrunk_ipv6_network}', actual: '{ipam_v6_network}'" ) ] @@ -109,7 +109,7 @@ def verify_ipam_records(subscription: Iptrunk) -> None: @step("Verify NetBox entries") -def verify_netbox_entries(subscription: Iptrunk): +def verify_netbox_entries(subscription: Iptrunk) -> None: """Validate required entries for an IP trunk in NetBox.""" nbclient = NetboxClient() netbox_errors = [] @@ -161,7 +161,7 @@ def validate_iptrunk() -> StepList: * Verify that TWAMP configuration is correct. """ return ( - init + begin >> store_process_subscription(Target.SYSTEM) >> unsync >> verify_ipam_records diff --git a/gso/workflows/office_router/create_imported_office_router.py b/gso/workflows/office_router/create_imported_office_router.py index e1cda4cdd924563c5eb3495997dce651fd1fd724..c0abaebca2df730cbc45001349879e015ca0db6a 100644 --- a/gso/workflows/office_router/create_imported_office_router.py +++ b/gso/workflows/office_router/create_imported_office_router.py @@ -4,7 +4,7 @@ from orchestrator import workflow from orchestrator.forms import FormPage from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, SubscriptionLifecycle -from orchestrator.workflow import StepList, done, init, step +from orchestrator.workflow import StepList, begin, done, step from orchestrator.workflows.steps import resync, set_status, store_process_subscription from pydantic import ConfigDict @@ -77,7 +77,7 @@ def initialize_subscription( def create_imported_office_router() -> StepList: """Import an office router without provisioning it.""" return ( - init + begin >> create_subscription >> store_process_subscription(Target.CREATE) >> initialize_subscription diff --git a/gso/workflows/router/activate_router.py b/gso/workflows/router/activate_router.py index b742c58cd5476685fc6ea8199fbcfa96cf865527..d1efc7276bf7565bb0645d63dfd9ac359a1b65e8 100644 --- a/gso/workflows/router/activate_router.py +++ b/gso/workflows/router/activate_router.py @@ -5,7 +5,7 @@ from orchestrator.forms import FormPage from orchestrator.forms.validators import Label from orchestrator.targets import Target from orchestrator.types import FormGenerator, SubscriptionLifecycle, UUIDstr -from orchestrator.workflow import StepList, done, init, inputstep, workflow +from orchestrator.workflow import StepList, begin, done, inputstep, workflow from orchestrator.workflows.steps import resync, set_status, store_process_subscription, unsync from orchestrator.workflows.utils import wrap_modify_initial_input_form @@ -49,7 +49,7 @@ def activate_router() -> StepList: * Update the subscription lifecycle state to ``ACTIVE``. """ return ( - init + begin >> store_process_subscription(Target.MODIFY) >> unsync >> verify_complete_checklist diff --git a/gso/workflows/router/create_imported_router.py b/gso/workflows/router/create_imported_router.py index a375965d2f2d770a97b9b00accd7cece86173382..68b23a2c2644aa647e797c78c8df11ea8a535283 100644 --- a/gso/workflows/router/create_imported_router.py +++ b/gso/workflows/router/create_imported_router.py @@ -4,7 +4,7 @@ from orchestrator import workflow from orchestrator.forms import FormPage from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, SubscriptionLifecycle -from orchestrator.workflow import StepList, done, init, step +from orchestrator.workflow import StepList, begin, done, step from orchestrator.workflows.steps import resync, set_status, store_process_subscription from pydantic import ConfigDict @@ -88,7 +88,7 @@ def initialize_subscription( def create_imported_router() -> StepList: """Import a router without provisioning it.""" return ( - init + begin >> create_subscription >> store_process_subscription(Target.CREATE) >> initialize_subscription diff --git a/gso/workflows/router/create_router.py b/gso/workflows/router/create_router.py index ff859d879a34b7163a1177064c5b1de4d4fc44c1..3ef4a6881c4fd5ee3802092cd44e942257c82659 100644 --- a/gso/workflows/router/create_router.py +++ b/gso/workflows/router/create_router.py @@ -8,7 +8,7 @@ from orchestrator.forms.validators import Choice, Label from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, SubscriptionLifecycle, UUIDstr from orchestrator.utils.errors import ProcessFailureError -from orchestrator.workflow import StepList, conditional, done, init, inputstep, step, workflow +from orchestrator.workflow import StepList, begin, conditional, done, inputstep, step, workflow from orchestrator.workflows.steps import resync, set_status, store_process_subscription from orchestrator.workflows.utils import wrap_create_initial_input_form from pydantic import ConfigDict, model_validator @@ -259,7 +259,7 @@ def create_router() -> StepList: router_is_nokia = conditional(lambda state: state["vendor"] == Vendor.NOKIA) return ( - init + begin >> create_subscription >> store_process_subscription(Target.CREATE) >> initialize_subscription diff --git a/gso/workflows/router/modify_connection_strategy.py b/gso/workflows/router/modify_connection_strategy.py index bc6be3ecc4b4a08605de17151ec7a14e740daf01..3aacfc0a5bffabe9d74ff5be5195471c675b416a 100644 --- a/gso/workflows/router/modify_connection_strategy.py +++ b/gso/workflows/router/modify_connection_strategy.py @@ -3,7 +3,7 @@ from orchestrator.forms import FormPage from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, UUIDstr -from orchestrator.workflow import StepList, done, init, step, workflow +from orchestrator.workflow import StepList, begin, done, step, workflow from orchestrator.workflows.steps import resync, store_process_subscription, unsync from orchestrator.workflows.utils import wrap_modify_initial_input_form from pydantic import ConfigDict @@ -49,4 +49,4 @@ def update_subscription_model(subscription: Router, connection_strategy: str) -> ) def modify_connection_strategy() -> StepList: """Modify the connection strategy.""" - return init >> store_process_subscription(Target.MODIFY) >> unsync >> update_subscription_model >> resync >> done + return begin >> store_process_subscription(Target.MODIFY) >> unsync >> update_subscription_model >> resync >> done diff --git a/gso/workflows/router/redeploy_base_config.py b/gso/workflows/router/redeploy_base_config.py index 0393a377abe9c5351e55f0181ee2e6a8ab30f229..7af29e25743b08b6ab2bfdf3f6c1676e70aa5005 100644 --- a/gso/workflows/router/redeploy_base_config.py +++ b/gso/workflows/router/redeploy_base_config.py @@ -4,7 +4,7 @@ from orchestrator.forms import FormPage from orchestrator.forms.validators import Label from orchestrator.targets import Target from orchestrator.types import FormGenerator, UUIDstr -from orchestrator.workflow import StepList, done, init, workflow +from orchestrator.workflow import StepList, begin, done, workflow from orchestrator.workflows.steps import resync, store_process_subscription, unsync from orchestrator.workflows.utils import wrap_modify_initial_input_form @@ -37,7 +37,7 @@ def redeploy_base_config() -> StepList: * Redeploy base config """ return ( - init + begin >> store_process_subscription(Target.MODIFY) >> unsync >> lso_interaction(deploy_base_config_dry) diff --git a/gso/workflows/router/terminate_router.py b/gso/workflows/router/terminate_router.py index 781e75813843db8dd4330fa746cc8a5c45015206..3409ab7267637047997efb85f9087ca672b57b48 100644 --- a/gso/workflows/router/terminate_router.py +++ b/gso/workflows/router/terminate_router.py @@ -9,7 +9,7 @@ from orchestrator.forms.validators import Label from orchestrator.targets import Target from orchestrator.types import FormGenerator, SubscriptionLifecycle, UUIDstr from orchestrator.utils.json import json_dumps -from orchestrator.workflow import StepList, conditional, done, init, step, workflow +from orchestrator.workflow import StepList, begin, conditional, done, step, workflow from orchestrator.workflows.steps import ( resync, set_status, @@ -121,7 +121,7 @@ def terminate_router() -> StepList: router_is_nokia = conditional(lambda state: state["router_is_nokia"]) return ( - init + begin >> store_process_subscription(Target.TERMINATE) >> unsync >> deprovision_loopback_ips diff --git a/gso/workflows/router/update_ibgp_mesh.py b/gso/workflows/router/update_ibgp_mesh.py index 0aa61cb65a09b64c5d4821b92c4fd85c92a2ef0a..ba8777bac1a3ab1ba44eb4e950721bf64e15e9e6 100644 --- a/gso/workflows/router/update_ibgp_mesh.py +++ b/gso/workflows/router/update_ibgp_mesh.py @@ -7,7 +7,7 @@ from orchestrator.forms import FormPage from orchestrator.forms.validators import Label from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, SubscriptionLifecycle, UUIDstr -from orchestrator.workflow import StepList, done, init, inputstep, step, workflow +from orchestrator.workflow import StepList, begin, done, inputstep, step, workflow from orchestrator.workflows.steps import resync, store_process_subscription, unsync from orchestrator.workflows.utils import wrap_modify_initial_input_form from pydantic import ConfigDict, model_validator @@ -248,7 +248,7 @@ def update_ibgp_mesh() -> StepList: * Update the subscription model. """ return ( - init + begin >> store_process_subscription(Target.MODIFY) >> unsync >> calculate_pe_router_list diff --git a/gso/workflows/router/validate_router.py b/gso/workflows/router/validate_router.py index 5e1447cebcccca74250740b4774cdf02d41098f6..eb5059ebdc9d8459d1ed7ac52953a573a14cc912 100644 --- a/gso/workflows/router/validate_router.py +++ b/gso/workflows/router/validate_router.py @@ -2,10 +2,11 @@ from orchestrator.targets import Target from orchestrator.utils.errors import ProcessFailureError -from orchestrator.workflow import StepList, done, init, step, workflow +from orchestrator.workflow import StepList, begin, done, step, workflow from orchestrator.workflows.steps import resync, store_process_subscription, unsync from orchestrator.workflows.utils import wrap_modify_initial_input_form -from workflows.router.update_ibgp_mesh import add_p_to_mesh_dry +from pydantic_forms.core import FormPage +from pydantic_forms.types import FormGenerator, UUIDstr from gso.products.product_types.router import Router from gso.services import infoblox @@ -13,6 +14,20 @@ from gso.services.librenms_client import LibreNMSClient from gso.services.lso_client import anonymous_lso_interaction from gso.services.netbox_client import NetboxClient from gso.utils.workflow_steps import deploy_base_config_dry, detect_configuration_drift +from gso.workflows.router.update_ibgp_mesh import add_p_to_mesh_dry + +TT_NUMBER_ZERO = "TT#0000000000000000" + + +def _seed_initial_state(subscription_id: UUIDstr) -> FormGenerator: + router = Router.from_subscription(subscription_id) + + class EmptyForm(FormPage): + pass + + yield EmptyForm + + return {"subscription": router, "tt_number": TT_NUMBER_ZERO} @step("Verify IPAM resources for loopback interface") @@ -52,7 +67,7 @@ def verify_librenms_entry(subscription: Router) -> None: @workflow( "Validate router configuration", target=Target.SYSTEM, - initial_input_form=wrap_modify_initial_input_form(None), + initial_input_form=wrap_modify_initial_input_form(_seed_initial_state), ) def validate_router() -> StepList: """Validate an existing, active Router subscription. @@ -64,7 +79,7 @@ def validate_router() -> StepList: * Validate configuration of the iBGP mesh """ return ( - init + begin >> store_process_subscription(Target.SYSTEM) >> unsync >> verify_ipam_loopback diff --git a/gso/workflows/site/create_imported_site.py b/gso/workflows/site/create_imported_site.py index 01a0e6f6c83ca0ac73e59426dfad639d4ad11851..4aec97f7995d7e3e3d8811e3936e4b179cac4b49 100644 --- a/gso/workflows/site/create_imported_site.py +++ b/gso/workflows/site/create_imported_site.py @@ -5,7 +5,7 @@ from uuid import UUID from orchestrator.forms import FormPage from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, SubscriptionLifecycle -from orchestrator.workflow import StepList, done, init, step, workflow +from orchestrator.workflow import StepList, begin, done, step, workflow from orchestrator.workflows.steps import resync, set_status, store_process_subscription from pydantic import ConfigDict @@ -79,7 +79,7 @@ def initialize_subscription( def create_imported_site() -> StepList: """Workflow to import a site without provisioning it.""" return ( - init + begin >> create_subscription >> store_process_subscription(Target.CREATE) >> initialize_subscription diff --git a/gso/workflows/site/create_site.py b/gso/workflows/site/create_site.py index c4290d7072e517abd2276e7369663b3685af0e61..9def57b5bea9e858204c0b489db998d54470d4b9 100644 --- a/gso/workflows/site/create_site.py +++ b/gso/workflows/site/create_site.py @@ -3,7 +3,7 @@ from orchestrator.forms import FormPage from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, SubscriptionLifecycle, UUIDstr -from orchestrator.workflow import StepList, done, init, step, workflow +from orchestrator.workflow import StepList, begin, done, step, workflow from orchestrator.workflows.steps import resync, set_status, store_process_subscription from orchestrator.workflows.utils import wrap_create_initial_input_form from pydantic import ConfigDict @@ -80,7 +80,7 @@ def initialize_subscription( def create_site() -> StepList: """Create a new site subscription.""" return ( - init + begin >> create_subscription >> store_process_subscription(Target.CREATE) >> initialize_subscription diff --git a/gso/workflows/site/modify_site.py b/gso/workflows/site/modify_site.py index ee48784e9c47757e4282c6e39353f2252edf32bb..62a659ed1e4d4146e3d177a5b1594169249dd6f8 100644 --- a/gso/workflows/site/modify_site.py +++ b/gso/workflows/site/modify_site.py @@ -3,7 +3,7 @@ from orchestrator.forms import FormPage from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, SubscriptionLifecycle, UUIDstr -from orchestrator.workflow import StepList, done, init, step, workflow +from orchestrator.workflow import StepList, begin, done, step, workflow from orchestrator.workflows.steps import ( resync, set_status, @@ -97,7 +97,7 @@ def modify_site() -> StepList: * Update the subscription model in the service database """ return ( - init + begin >> store_process_subscription(Target.MODIFY) >> unsync >> modify_site_subscription diff --git a/gso/workflows/site/terminate_site.py b/gso/workflows/site/terminate_site.py index 02be6f7c76f4f01ada85ddaf91e552575eb3c18a..f6caec6a3ce4a5e0b8e7a023504dfc11ac5b8138 100644 --- a/gso/workflows/site/terminate_site.py +++ b/gso/workflows/site/terminate_site.py @@ -4,7 +4,7 @@ from orchestrator.forms import FormPage from orchestrator.forms.validators import Label from orchestrator.targets import Target from orchestrator.types import FormGenerator, SubscriptionLifecycle, UUIDstr -from orchestrator.workflow import StepList, done, init, workflow +from orchestrator.workflow import StepList, begin, done, workflow from orchestrator.workflows.steps import ( resync, set_status, @@ -42,7 +42,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: def terminate_site() -> StepList: """Terminate a site subscription.""" return ( - init + begin >> store_process_subscription(Target.TERMINATE) >> unsync >> set_status(SubscriptionLifecycle.TERMINATED) diff --git a/gso/workflows/super_pop_switch/create_imported_super_pop_switch.py b/gso/workflows/super_pop_switch/create_imported_super_pop_switch.py index f44f38a502575814cd15abc30707f0ba64af92a2..008fde911c7593450e7e71d3f76363f5cf80f04b 100644 --- a/gso/workflows/super_pop_switch/create_imported_super_pop_switch.py +++ b/gso/workflows/super_pop_switch/create_imported_super_pop_switch.py @@ -4,7 +4,7 @@ from orchestrator import workflow from orchestrator.forms import FormPage from orchestrator.targets import Target from orchestrator.types import FormGenerator, State, SubscriptionLifecycle -from orchestrator.workflow import StepList, done, init, step +from orchestrator.workflow import StepList, begin, done, step from orchestrator.workflows.steps import resync, set_status, store_process_subscription from pydantic import ConfigDict @@ -76,7 +76,7 @@ def initialize_subscription( def create_imported_super_pop_switch() -> StepList: """Import a Super PoP switch without provisioning it.""" return ( - init + begin >> create_subscription >> store_process_subscription(Target.CREATE) >> initialize_subscription