From 98299b68ae8f182fb57df0a1a9c7f7d52cf871fb Mon Sep 17 00:00:00 2001 From: root <root@simone04.dev.gap.geant.org> Date: Mon, 7 Aug 2023 13:10:11 +0000 Subject: [PATCH] Modify creation of site and device --- gso/workflows/device/create_device.py | 2 -- gso/workflows/site/create_site.py | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gso/workflows/device/create_device.py b/gso/workflows/device/create_device.py index 391b48b4..e3cc74ac 100644 --- a/gso/workflows/device/create_device.py +++ b/gso/workflows/device/create_device.py @@ -96,13 +96,11 @@ def get_info_from_ipam(subscription: DeviceProvisioning) -> State: def initialize_subscription( subscription: device.DeviceInactive, hostname: str, - ts_address: ipaddress.IPv4Address, ts_port: int, device_vendor: device_pb.DeviceVendor, device_site: str, device_role: device_pb.DeviceRole, ) -> State: - subscription.device.device_ts_address = str(ts_address) subscription.device.device_ts_port = ts_port subscription.device.device_vendor = device_vendor subscription.device.device_site = Site.from_subscription(device_site).site diff --git a/gso/workflows/site/create_site.py b/gso/workflows/site/create_site.py index 30dc2c17..b597a913 100644 --- a/gso/workflows/site/create_site.py +++ b/gso/workflows/site/create_site.py @@ -25,6 +25,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: site_bgp_community_id: int site_internal_id: int site_tier: site_pb.SiteTier + site_ts_address: str user_input = yield CreateSiteForm @@ -53,6 +54,7 @@ def initialize_subscription( site_bgp_community_id: int, site_internal_id: int, site_tier: site_pb.SiteTier, + site_ts_address: str, ) -> State: subscription.site.site_name = site_name subscription.site.site_city = site_city @@ -63,6 +65,7 @@ def initialize_subscription( subscription.site.site_bgp_community_id = site_bgp_community_id subscription.site.site_internal_id = site_internal_id subscription.site.site_tier = site_tier + subscription.site.site_ts_address = site_ts_address subscription.description = f"Site {site_name}" @@ -85,4 +88,4 @@ def create_site() -> StepList: >> set_status(SubscriptionLifecycle.ACTIVE) >> resync >> done - ) + site_tier) -- GitLab