Skip to content

Commit 9b72a47

Browse files
committed
version constrain nf network product
1 parent 188d9c5 commit 9b72a47

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

netfoundry/network.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import re
55
import time
66

7+
from packaging.version import parse
78
from requests.exceptions import JSONDecodeError
89

910
from netfoundry.exceptions import NetworkBoundaryViolation, UnknownResourceType
@@ -56,7 +57,7 @@ def __init__(self, NetworkGroup: object, network_id: str = None, network_name: s
5657
self.product_version = self.describe['productVersion']
5758
self.owner_identity_id = self.describe['ownerIdentityId']
5859
self.size = self.describe['size']
59-
self.o365_breakout_category = self.describe['o365BreakoutCategory']
60+
self.o365_breakout_category = self.describe.get('o365BreakoutCategory')
6061
self.created_at = self.describe['createdAt']
6162
self.updated_at = self.describe['updatedAt']
6263
self.created_by = self.describe['createdBy']
@@ -1228,6 +1229,9 @@ def get_controller_session(self, id: str):
12281229
Note that this function requires privileged access to the controller and is intended for emergency, read-only operations by customer support engineers.
12291230
:param id: the UUID of the network controller
12301231
"""
1232+
1233+
if parse(self.product_version) >= parse("8.0.0"):
1234+
raise RuntimeError(f"get_controller_session() is unavailable in network version {self.product_version} and later.")
12311235
url = self.audience+'core/v2/network-controllers/'+id+'/session'
12321236
try:
12331237
session, status_symbol = get_generic_resource_by_url(setup=self, url=url)

0 commit comments

Comments
 (0)