Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • goat/gap/geant-service-orchestrator
1 result
Show changes
Commits on Source (3)
......@@ -8,6 +8,7 @@ repos:
args:
- --fix
- --preview
- --ignore=PLR0917,PLR0914
# Run the formatter.
- id: ruff-format
args:
......
......@@ -6,7 +6,7 @@
"router_vendor": "juniper",
"router_role": "pe",
"router_lo_ipv4_address": "62.40.119.2",
"router_lo_ipv6_address": "2001:798:1ab::2",
"router_lo_ipv6_address": "2001:799:1ab::2",
"router_lo_iso_address": "49.51e5.0001.0620.4011.9002.00",
"is_ias_connected": true
},
......@@ -17,7 +17,7 @@
"router_vendor": "juniper",
"router_role": "pe",
"router_lo_ipv4_address": "62.40.119.1",
"router_lo_ipv6_address": "2001:798:1ab::1",
"router_lo_ipv6_address": "2001:799:1ab::1",
"router_lo_iso_address": "49.51e5.0001.0620.4011.9001.00",
"is_ias_connected": false
},
......@@ -28,7 +28,7 @@
"router_vendor": "juniper",
"router_role": "pe",
"router_lo_ipv4_address": "62.40.119.3",
"router_lo_ipv6_address": "2001:798:1ab::3",
"router_lo_ipv6_address": "2001:799:1ab::3",
"router_lo_iso_address": "49.51e5.0001.0620.4011.9003.00",
"is_ias_connected": false
},
......@@ -39,7 +39,7 @@
"router_vendor": "juniper",
"router_role": "pe",
"router_lo_ipv4_address": "62.40.119.4",
"router_lo_ipv6_address": "2001:798:1ab::4",
"router_lo_ipv6_address": "2001:799:1ab::4",
"router_lo_iso_address": "49.51e5.0001.0620.4011.9004.00",
"is_ias_connected": false
},
......@@ -50,7 +50,7 @@
"router_vendor": "juniper",
"router_role": "pe",
"router_lo_ipv4_address": "62.40.119.5",
"router_lo_ipv6_address": "2001:798:1ab::5",
"router_lo_ipv6_address": "2001:799:1ab::5",
"router_lo_iso_address": "49.51e5.0001.0620.4011.9005.00",
"is_ias_connected": true
}
......
......@@ -7,7 +7,6 @@ configured to run from A to C. B is then no longer associated with this IP trunk
import copy
import json
import re
from typing import NoReturn
from uuid import uuid4
from orchestrator import step, workflow
......@@ -85,10 +84,12 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
current_router_site = Router.from_subscription(router_id).router.router_site.subscription
old_side_site = Router.from_subscription(migrate_form_input.replace_side).router.router_site
if (
migrate_form_input.migrate_to_different_site
and current_router_site.subscription_id == old_side_site.owner_subscription_id
not migrate_form_input.migrate_to_different_site
and current_router_site.subscription_id != old_side_site.owner_subscription_id
):
# We want to stay on the same site, so all routers that are in different sites get skipped.
continue
# If migrate_to_different_site is true, we can add ALL routers to the result map
routers[str(router_id)] = router["description"]
new_router_enum = Choice("Select a new router", zip(routers.keys(), routers.items(), strict=True)) # type: ignore[arg-type]
......@@ -148,7 +149,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
new_lag_member_interfaces: ae_members # type: ignore[valid-type]
@validator("new_lag_interface", allow_reuse=True, pre=True, always=True)
def lag_interface_proper_name(cls, new_lag_interface: str) -> str | NoReturn:
def lag_interface_proper_name(cls, new_lag_interface: str) -> str:
if get_router_vendor(new_router) == RouterVendor.JUNIPER:
juniper_lag_re = re.compile("^ae\\d{1,2}$")
if not juniper_lag_re.match(new_lag_interface):
......
......@@ -76,6 +76,7 @@ def migrate_form_input(
{
"tt_number": faker.tt_number(),
"replace_side": replace_side,
"migrate_to_different_site": True,
},
{
"new_node": new_router,
......