From 23004a82c288cfb905c929b9381f819fb8204e1a Mon Sep 17 00:00:00 2001 From: Karel van Klink <karel.vanklink@geant.org> Date: Fri, 19 Apr 2024 10:45:31 +0200 Subject: [PATCH] Rename all uses of the init step to begin --- gso/workflows/iptrunk/activate_iptrunk.py | 4 ++-- .../iptrunk/create_imported_iptrunk.py | 4 ++-- gso/workflows/iptrunk/create_iptrunk.py | 2 +- gso/workflows/iptrunk/deploy_twamp.py | 4 ++-- gso/workflows/iptrunk/migrate_iptrunk.py | 4 ++-- gso/workflows/iptrunk/modify_isis_metric.py | 4 ++-- .../iptrunk/modify_trunk_interface.py | 4 ++-- gso/workflows/iptrunk/terminate_iptrunk.py | 6 ++--- gso/workflows/iptrunk/validate_iptrunk.py | 16 ++++++------- .../create_imported_office_router.py | 4 ++-- gso/workflows/router/activate_router.py | 4 ++-- .../router/create_imported_router.py | 4 ++-- gso/workflows/router/create_router.py | 4 ++-- .../router/modify_connection_strategy.py | 4 ++-- gso/workflows/router/redeploy_base_config.py | 4 ++-- gso/workflows/router/terminate_router.py | 4 ++-- gso/workflows/router/update_ibgp_mesh.py | 4 ++-- gso/workflows/router/validate_router.py | 23 +++++++++++++++---- gso/workflows/site/create_imported_site.py | 4 ++-- gso/workflows/site/create_site.py | 4 ++-- gso/workflows/site/modify_site.py | 4 ++-- gso/workflows/site/terminate_site.py | 4 ++-- .../create_imported_super_pop_switch.py | 4 ++-- 23 files changed, 69 insertions(+), 54 deletions(-) diff --git a/gso/workflows/iptrunk/activate_iptrunk.py b/gso/workflows/iptrunk/activate_iptrunk.py index a98a0446..f229599f 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 bd2ea987..dd5ceed0 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 30f2c46b..ae5a1432 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 10970127..60e852cc 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 b0dfb950..913d7836 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 4e8332aa..ed38b1be 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 92f71d6d..b8f272a6 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 1ae61b80..0c8a2726 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 45e26d3e..c0715370 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 e1cda4cd..c0abaebc 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 b742c58c..d1efc727 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 a375965d..68b23a2c 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 ff859d87..3ef4a688 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 bc6be3ec..3aacfc0a 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 0393a377..7af29e25 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 781e7581..3409ab72 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 0aa61cb6..ba8777ba 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 5e1447ce..eb5059eb 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 01a0e6f6..4aec97f7 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 c4290d70..9def57b5 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 ee48784e..62a659ed 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 02be6f7c..f6caec6a 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 f44f38a5..008fde91 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 -- GitLab