diff --git a/data/routers.json b/data/routers.json index 0fa3c5043d7f0861f2585b1d634aa62a4e1ee9fd..a68e7fe83737c5e893d63f068ef9d24d95a35892 100644 --- a/data/routers.json +++ b/data/routers.json @@ -4,7 +4,7 @@ "hostname": "rt1", "ts_port": 22111, "router_vendor": "juniper", - "router_role": "p", + "router_role": "pe", "router_lo_ipv4_address": "62.40.119.2", "router_lo_ipv6_address": "2001:798:1ab::2", "router_lo_iso_address": "49.51e5.0001.0620.4011.9002.00", @@ -15,7 +15,7 @@ "hostname": "rt1", "ts_port": 22111, "router_vendor": "juniper", - "router_role": "p", + "router_role": "pe", "router_lo_ipv4_address": "62.40.119.1", "router_lo_ipv6_address": "2001:798:1ab::1", "router_lo_iso_address": "49.51e5.0001.0620.4011.9001.00", @@ -26,7 +26,7 @@ "hostname": "rt1", "ts_port": 22111, "router_vendor": "juniper", - "router_role": "p", + "router_role": "pe", "router_lo_ipv4_address": "62.40.119.3", "router_lo_ipv6_address": "2001:798:1ab::3", "router_lo_iso_address": "49.51e5.0001.0620.4011.9003.00", @@ -37,18 +37,18 @@ "hostname": "rt1", "ts_port": 22111, "router_vendor": "juniper", - "router_role": "p", + "router_role": "pe", "router_lo_ipv4_address": "62.40.119.4", "router_lo_ipv6_address": "2001:798:1ab::4", "router_lo_iso_address": "49.51e5.0001.0620.4011.9004.00", "is_ias_connected": false }, - { + { "router_site": "LON", "hostname": "rt1", "ts_port": 22111, "router_vendor": "juniper", - "router_role": "p", + "router_role": "pe", "router_lo_ipv4_address": "62.40.119.5", "router_lo_ipv6_address": "2001:798:1ab::5", "router_lo_iso_address": "49.51e5.0001.0620.4011.9005.00", diff --git a/data/sites.json b/data/sites.json index 3dc257eccf5f2290b7c4f2caf16a0bf8e0555842..1ce7427645053e6c6774534e895293178e04097f 100644 --- a/data/sites.json +++ b/data/sites.json @@ -9,7 +9,7 @@ "site_bgp_community_id": 13, "site_internal_id": 2, "site_tier": "1", - "site_ts_address": "62.40.111.195", + "site_ts_address": "62.40.111.195" }, { "site_name": "ATH", @@ -21,7 +21,7 @@ "site_bgp_community_id": 14, "site_internal_id": 4, "site_tier": "1", - "site_ts_address": "62.40.111.196", + "site_ts_address": "62.40.111.196" }, { "site_name": "BIL", @@ -33,7 +33,7 @@ "site_bgp_community_id": 47, "site_internal_id": 3, "site_tier": "1", - "site_ts_address": "62.40.111.197", + "site_ts_address": "62.40.111.197" }, { "site_name": "DUB", @@ -50,12 +50,12 @@ { "site_name": "LON", "site_city": "London", - "site_country": "England", + "site_country": "United Kingdom", "site_country_code": "UK", "site_latitude": 51.49821912962843, "site_longitude": -0.015228819041376851, "site_bgp_community_id": 28, - "site_internal_id": "1", + "site_internal_id": 1, "site_tier": "1", "site_ts_address": "62.40.111.199" } diff --git a/data/trunks.json b/data/trunks.json index eb2cb2c9f75d784396090c40f40b44ca2bb126b2..f1c2b8720358dc0d63aa9863af417f3818427eac 100644 --- a/data/trunks.json +++ b/data/trunks.json @@ -40,7 +40,7 @@ "id": "LGS-00003", "config": { "common": { - "link_speed": "100g", + "link_speed": "100G", "minimum_links": 1, "isis_metric": 500, "type": "Leased" @@ -77,7 +77,7 @@ "id": "LGS-00004", "config": { "common": { - "link_speed": "400g", + "link_speed": "400G", "minimum_links": 1, "isis_metric": 100, "type": "Dark_fiber" @@ -114,7 +114,7 @@ "id": "LGS-00006", "config": { "common": { - "link_speed": "100g", + "link_speed": "100G", "minimum_links": 1, "isis_metric": 500, "type": "Dark_fiber" @@ -151,7 +151,7 @@ "id": "LGS-00007", "config": { "common": { - "link_speed": "100g", + "link_speed": "100G", "minimum_links": 1, "isis_metric": 500, "type": "Dark_fiber" @@ -188,7 +188,7 @@ "id": "LGS-00008", "config": { "common": { - "link_speed": "100g", + "link_speed": "100G", "minimum_links": 1, "isis_metric": 500, "type": "Dark_fiber" @@ -225,7 +225,7 @@ "id": "LGS-00012", "config": { "common": { - "link_speed": "100g", + "link_speed": "100G", "minimum_links": 1, "isis_metric": 500, "type": "Dark_fiber" @@ -262,7 +262,7 @@ "id": "LGS-00013", "config": { "common": { - "link_speed": "100g", + "link_speed": "100G", "minimum_links": 1, "isis_metric": 500, "type": "Dark_fiber" diff --git a/gso/cli/imports.py b/gso/cli/imports.py index 514143a2150d7244b4e3a4dcaf09332150dac930..9bdf8e79db93fc070c2125a6bb3bbd58a153b917 100644 --- a/gso/cli/imports.py +++ b/gso/cli/imports.py @@ -173,7 +173,7 @@ def import_iptrunks(filepath: str = common_filepath_option) -> None: except ValidationError as e: typer.echo(f"Validation error: {e}") - if successfully_imported_data: - typer.echo("Successfully imported IP Trunks:") - for item in successfully_imported_data: - typer.echo(f"- {item}") + if successfully_imported_data: + typer.echo("Successfully imported IP Trunks:") + for item in successfully_imported_data: + typer.echo(f"- {item}") diff --git a/gso/utils/helpers.py b/gso/utils/helpers.py index c5316a054ad84bf6dab5f82788f03675d40f871d..1fde7d65c92d32229d03b3c9dd2860a5ebf8804a 100644 --- a/gso/utils/helpers.py +++ b/gso/utils/helpers.py @@ -199,13 +199,14 @@ def validate_ipv4_or_ipv6(value: str) -> str: def validate_country_code(country_code: str) -> str: """Validate that a country code is valid.""" - try: - pycountry.countries.lookup(country_code) - except LookupError as e: - msg = "Invalid or non-existent country code, it must be in ISO 3166-1 alpha-2 format." - raise ValueError(msg) from e - else: - return country_code + # Check for the UK code before attempting to look it up since it's known as "GB" in the pycountry database. + if country_code != "UK": + try: + pycountry.countries.lookup(country_code) + except LookupError as e: + msg = "Invalid or non-existent country code, it must be in ISO 3166-1 alpha-2 format." + raise ValueError(msg) from e + return country_code def validate_site_name(site_name: str) -> str: