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

Update start Moodi step to use scoped subscription when exists which uses when...

Update start Moodi step to use scoped subscription when exists which uses when we want to add/change some field in subscription before making the change in CoreDB
parent d9076d8b
No related branches found
No related tags found
1 merge request!370Update migrate L3 core service in order to call Moodi with the new...
Pipeline #92156 passed
......@@ -408,11 +408,11 @@ def start_moodi() -> StepList:
host = load_oss_params().MOODI.host
@step("Start Moodi")
def _start_moodi(subscription: dict[str, Any]) -> LSOState:
def _start_moodi(state: State) -> LSOState:
return {
"playbook_name": "moodi_telemetry/playbooks/start_moodi.yaml",
"inventory": {"all": {"hosts": {host: None}}},
"extra_vars": {"subscription": subscription},
"extra_vars": {"subscription": state.get("scoped_subscription", state.get("subscription"))},
}
return _is_moodi_enabled(indifferent_lso_interaction(_start_moodi))
......
......@@ -26,12 +26,11 @@ from pydantic_forms.validators import Choice, Divider, Label
from gso.products.product_types.edge_port import EdgePort
from gso.products.product_types.l3_core_service import L3CoreService
from gso.services.lso_client import LSOState, indifferent_lso_interaction, lso_interaction
from gso.services.lso_client import LSOState, lso_interaction
from gso.services.partners import get_partner_by_id
from gso.services.subscriptions import get_active_edge_port_subscriptions
from gso.settings import load_oss_params
from gso.utils.types.tt_number import TTNumber
from gso.utils.workflow_steps import IS_HUMAN_INITIATED_WF_KEY, SKIP_MOODI_KEY, stop_moodi
from gso.utils.workflow_steps import IS_HUMAN_INITIATED_WF_KEY, SKIP_MOODI_KEY, start_moodi, stop_moodi
from gso.workflows.shared import create_summary_form
......@@ -271,24 +270,6 @@ def generate_scoped_subscription_model(
raise ProcessFailureError(msg, details=source_edge_port)
_is_moodi_enabled = conditional(lambda state: load_oss_params().MOODI.moodi_enabled and not state.get(SKIP_MOODI_KEY))
def start_moodi() -> StepList:
"""Start monitoring on demand using Moodi Telemetry stack with the scoped subscription."""
host = load_oss_params().MOODI.host
@step("Start Moodi")
def _start_moodi(scoped_subscription: dict[str, Any]) -> LSOState:
return {
"playbook_name": "moodi_telemetry/playbooks/start_moodi.yaml",
"inventory": {"all": {"hosts": {host: None}}},
"extra_vars": {"subscription": scoped_subscription},
}
return _is_moodi_enabled(indifferent_lso_interaction(_start_moodi))
@step("[DRY RUN] Configure service on destination Edge Port")
def deploy_destination_ep_dry(
scoped_subscription: dict[str, Any],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment