Skip to content
Snippets Groups Projects
Commit 4c2f7b7b authored by Mohammad Torkashvand's avatar Mohammad Torkashvand
Browse files

add anonymous_indifferent_lso_interaction step

parent 456a7004
No related branches found
Tags 2.27
1 merge request!321add anonymous_indifferent_lso_interaction step
Pipeline #90768 passed
......@@ -267,3 +267,25 @@ def anonymous_lso_interaction(provisioning_step: Step, validation_step: Step = _
)
>> _clean_state
)
def anonymous_indifferent_lso_interaction(provisioning_step: Step) -> StepList:
"""Interact with the provisioning proxy :term:`LSO` without any user input.
Similar to the anonymous LSO interaction, but indifferent about the outcome of the Ansible playbook that is executed
Args:
provisioning_step: A workflow step to remotely provision a subscription.
"""
return (
begin
>> provisioning_step
>> _inventory_is_not_empty(
callback_step(
name="Running Ansible playbook",
action_step=_execute_playbook,
validate_step=_ignore_results,
)
)
>> _clean_state
)
......@@ -17,7 +17,7 @@ from pydantic_forms.validators import Label
from gso.products.product_blocks.router import RouterRole
from gso.products.product_types.iptrunk import Iptrunk
from gso.services.kentik_client import KentikClient, NewKentikDevice
from gso.services.lso_client import LSOState, indifferent_lso_interaction
from gso.services.lso_client import LSOState, anonymous_indifferent_lso_interaction, indifferent_lso_interaction
from gso.settings import load_oss_params
from gso.utils.helpers import generate_inventory_for_routers
from gso.utils.shared_enums import Vendor
......@@ -416,6 +416,17 @@ def stop_moodi() -> StepList:
"""Stop Moodi Telemetry monitoring on demand."""
host = load_oss_params().MOODI.host
@inputstep("Confirm stopping on-demand monitoring.", assignee=Assignee("SYSTEM"))
def _confirm_stopping_moodi(state: State) -> FormGenerator:
class ConfirmStoppingPage(FormPage):
model_config = ConfigDict()
run_results: Label = "Please confirm that you want to stop Moodi."
yield ConfirmStoppingPage
return state
@step("Stop Moodi")
def _stop_moodi(subscription: dict[str, Any]) -> LSOState:
return {
......@@ -424,7 +435,9 @@ def stop_moodi() -> StepList:
"extra_vars": {"subscription": subscription},
}
return _is_moodi_enabled(indifferent_lso_interaction(_stop_moodi))
return _is_moodi_enabled(_confirm_stopping_moodi) >> _is_moodi_enabled(
anonymous_indifferent_lso_interaction(_stop_moodi)
)
@step("Create Kentik device")
......
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