Skip to content
Snippets Groups Projects
Commit eccfc865 authored by geant-release-service's avatar geant-release-service
Browse files

Finished release 3.6.

parents 0019f351 96db6a02
No related branches found
No related tags found
No related merge requests found
Pipeline #94126 failed
# Changelog
# [3.6] - 2025-05-15
- Stop validating Edge Ports that are on a Juniper router.
- Allow skipping Ansible steps in the Edge Port termination workflow.
- Update translations.
# [3.5] - 2025-05-12
- Add a new CLI command for interacting with the task scheduler.
- Fix a bug in the subscription validation task.
......
......@@ -42,6 +42,7 @@
"mac_address": "MAC address",
"ga_id": "GÉANT GA-ID",
"gs_id": "GÉANT GS-ID",
"custom_service_name": "IMS Service Name",
"bfd_enabled": "BFD enabled",
"bfd_multiplier": "BFD multiplier",
......
......@@ -9,7 +9,9 @@ from orchestrator.types import SubscriptionLifecycle
from orchestrator.workflow import StepList, begin, done, step
from orchestrator.workflows.steps import resync, set_status, store_process_subscription, unsync
from orchestrator.workflows.utils import wrap_modify_initial_input_form
from pydantic import Field
from pydantic_forms.types import FormGenerator, UUIDstr
from pydantic_forms.validators import Label
from gso.products.product_types.edge_port import EdgePort
from gso.services.lso_client import LSOState, lso_interaction
......@@ -24,6 +26,9 @@ def initial_input_form_generator() -> FormGenerator:
class TerminateForm(SubmitFormPage):
tt_number: TTNumber
label: Label = Field("Should this workflow run Ansible playbooks to remove configuration from the router?")
run_ansible_steps: bool = True
user_input = yield TerminateForm
return user_input.model_dump()
......@@ -83,13 +88,14 @@ def netbox_clean_up(subscription: EdgePort) -> None:
def terminate_edge_port() -> StepList:
"""Terminate a new edge port in the network."""
router_is_nokia = conditional(lambda state: state["subscription"]["edge_port"]["node"]["vendor"] == Vendor.NOKIA)
run_ansible_steps = conditional(lambda state: state["run_ansible_steps"])
return (
begin
>> store_process_subscription(Target.TERMINATE)
>> unsync
>> lso_interaction(remove_edge_port_dry)
>> lso_interaction(remove_edge_port_real)
>> run_ansible_steps(lso_interaction(remove_edge_port_dry))
>> run_ansible_steps(lso_interaction(remove_edge_port_real))
>> router_is_nokia(netbox_clean_up)
>> set_status(SubscriptionLifecycle.TERMINATED)
>> resync
......
......@@ -78,21 +78,22 @@ def verify_base_config(subscription: dict[str, Any]) -> LSOState:
"Validate Edge Port Configuration", target=Target.SYSTEM, initial_input_form=wrap_modify_initial_input_form(None)
)
def validate_edge_port() -> StepList:
"""Validate an existing, active Edge port subscription.
"""Validate an existing, active Edge port subscription if it is on a Nokia device.
* Check correct configuration of interfaces in NetBox, only when the Edge Port is on a Nokia device.
* Check correct configuration of interfaces in NetBox.
* Verify create Edge port configuration.
"""
edge_port_is_on_nokia = conditional(
lambda state: state["subscription"]["edge_port"]["node"]["vendor"] == Vendor.NOKIA
edge_port_is_on_juniper = conditional(
lambda state: state["subscription"]["edge_port"]["node"]["vendor"] == Vendor.JUNIPER
)
return (
begin
>> store_process_subscription(Target.SYSTEM)
>> unsync
>> prepare_state
>> edge_port_is_on_nokia(verify_netbox_entries)
>> edge_port_is_on_juniper(done)
>> unsync
>> verify_netbox_entries
>> anonymous_lso_interaction(verify_base_config)
>> resync
>> done
......
......@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
setup(
name="geant-service-orchestrator",
version="3.5",
version="3.6",
author="GÉANT Orchestration and Automation Team",
author_email="goat@geant.org",
description="GÉANT Service Orchestrator",
......
......@@ -13,12 +13,14 @@ from test.workflows import (
@pytest.mark.workflow()
@pytest.mark.parametrize("include_lso_steps", [True, False])
@patch("gso.services.netbox_client.NetboxClient.delete_interface")
@patch("gso.services.netbox_client.NetboxClient.free_interface")
def test_successful_edge_port_termination(
mocked_free_interface,
mocked_delete_interface,
edge_port_subscription_factory,
include_lso_steps,
faker,
):
# Set up mock return values
......@@ -32,12 +34,14 @@ def test_successful_edge_port_termination(
{"subscription_id": subscription_id},
{
"tt_number": faker.tt_number(),
"run_ansible_steps": include_lso_steps,
},
]
result, process_stat, step_log = run_workflow("terminate_edge_port", initial_data)
for _ in range(2):
result, step_log = assert_lso_interaction_success(result, process_stat, step_log)
if include_lso_steps:
for _ in range(2):
result, step_log = assert_lso_interaction_success(result, process_stat, step_log)
assert_complete(result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment