From d09f51eded17a292e45d7a8b487206912083ec0a Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Sun, 19 Oct 2025 12:11:44 -0400 Subject: [PATCH 1/4] configure flake8 --- .python-flake8-config => .flake8 | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .python-flake8-config => .flake8 (100%) diff --git a/.python-flake8-config b/.flake8 similarity index 100% rename from .python-flake8-config rename to .flake8 From 16be19be6ecbd6ffa8aa750aec3c9b13e5e60250 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Sun, 19 Oct 2025 12:11:59 -0400 Subject: [PATCH 2/4] version constrain requests --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 14059a7..151defa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,7 @@ install_requires = pygments >= 2.11 pyjwt >= 2.3 pyyaml >= 5.4 - requests >= 2.27 + requests >= 2.27, < 2.30 tabulate >= 0.8 requests-cache >= 0.9.4 setup_requires = From 188d9c502c89feab26759967a34d0a388e6078bd Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Sun, 19 Oct 2025 12:12:56 -0400 Subject: [PATCH 3/4] stop importing unused blist --- netfoundry/ctl.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/netfoundry/ctl.py b/netfoundry/ctl.py index 7aaf42d..34fe585 100644 --- a/netfoundry/ctl.py +++ b/netfoundry/ctl.py @@ -13,7 +13,6 @@ import signal import jwt import tempfile -from builtins import list as blist from json import dumps as json_dumps from json import load as json_load from json import loads as json_loads @@ -43,9 +42,12 @@ from .organization import Organization from .utility import DC_PROVIDERS, EMBED_NET_RESOURCES, IDENTITY_ID_PROPERTIES, MUTABLE_NET_RESOURCES, MUTABLE_RESOURCE_ABBREV, RESOURCE_ABBREV, RESOURCES, any_in, get_generic_resource_by_type_and_id, normalize_caseless, plural, propid2type, singular -set_metadata(version=f"v{netfoundry_version}", author="NetFoundry", name="nfctl") # must precend import milc.cli -from milc import cli, questions # this uses metadata set above -from milc.subcommand import config # this creates the config subcommand +# must precend import milc.cli +set_metadata(version=f"v{netfoundry_version}", author="NetFoundry", name="nfctl") +# this uses metadata set above +from milc import cli, questions # noqa: E402 +# this creates the config subcommand +from milc.subcommand import config # noqa: F401,E402 if platform.system() == 'Linux': # this allows the app the terminate gracefully when piped to a truncating consumer like `head` From 9b72a4730fbb3271b84eb3978d9963f4b26fb6e4 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Sun, 19 Oct 2025 12:13:11 -0400 Subject: [PATCH 4/4] version constrain nf network product --- netfoundry/network.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/netfoundry/network.py b/netfoundry/network.py index 9447de5..a0f10ff 100644 --- a/netfoundry/network.py +++ b/netfoundry/network.py @@ -4,6 +4,7 @@ import re import time +from packaging.version import parse from requests.exceptions import JSONDecodeError from netfoundry.exceptions import NetworkBoundaryViolation, UnknownResourceType @@ -56,7 +57,7 @@ def __init__(self, NetworkGroup: object, network_id: str = None, network_name: s self.product_version = self.describe['productVersion'] self.owner_identity_id = self.describe['ownerIdentityId'] self.size = self.describe['size'] - self.o365_breakout_category = self.describe['o365BreakoutCategory'] + self.o365_breakout_category = self.describe.get('o365BreakoutCategory') self.created_at = self.describe['createdAt'] self.updated_at = self.describe['updatedAt'] self.created_by = self.describe['createdBy'] @@ -1228,6 +1229,9 @@ def get_controller_session(self, id: str): Note that this function requires privileged access to the controller and is intended for emergency, read-only operations by customer support engineers. :param id: the UUID of the network controller """ + + if parse(self.product_version) >= parse("8.0.0"): + raise RuntimeError(f"get_controller_session() is unavailable in network version {self.product_version} and later.") url = self.audience+'core/v2/network-controllers/'+id+'/session' try: session, status_symbol = get_generic_resource_by_url(setup=self, url=url)