From a0535255d0e07295f078f2dc32c246d2e2a0bf69 Mon Sep 17 00:00:00 2001 From: virlos Date: Tue, 20 Aug 2024 14:33:57 +0200 Subject: [PATCH] SIMPLE-6827 - removed MAC address block support (#114) --- tests/conftest.py | 2 +- virl2_client/exceptions.py | 4 ---- virl2_client/models/system.py | 29 +---------------------------- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 26faaad..0506dba 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -93,7 +93,7 @@ def respx_mock_with_labs(respx_mock): some runtime data, like node states and simulation_statistics. """ respx_mock.get(FAKE_HOST_API + "system_information").respond( - json={"version": CURRENT_VERSION, "ready": True}, + json={"version": CURRENT_VERSION, "ready": True, "oui": "52:54:00:00:00:00"}, ) respx_mock.post(FAKE_HOST_API + "authenticate").respond(json="BOGUS_TOKEN") respx_mock.get(FAKE_HOST_API + "authok") diff --git a/virl2_client/exceptions.py b/virl2_client/exceptions.py index e032973..d05c295 100644 --- a/virl2_client/exceptions.py +++ b/virl2_client/exceptions.py @@ -92,10 +92,6 @@ class PyatsDeviceNotFound(PyatsException): pass -class InvalidMacAddressBlock(VirlException): - message = "MAC address block has to be in range 0-7" - - class ControllerNotFound(VirlException): message = "Controller not found" diff --git a/virl2_client/models/system.py b/virl2_client/models/system.py index a9e9b31..42799c3 100644 --- a/virl2_client/models/system.py +++ b/virl2_client/models/system.py @@ -24,7 +24,7 @@ import time from typing import TYPE_CHECKING, Any -from virl2_client.exceptions import ControllerNotFound, InvalidMacAddressBlock +from virl2_client.exceptions import ControllerNotFound from ..utils import _deprecated_argument, get_url_from_template @@ -42,7 +42,6 @@ class SystemManagement: "external_connectors": "system/external_connectors", "external_connector": "system/external_connectors/{connector_id}", "web_session_timeout": "web_session_timeout/{timeout}", - "mac_address_block": "mac_address_block/{block}", "host_configuration": "system/compute_hosts/configuration", } @@ -267,32 +266,6 @@ def set_web_session_timeout(self, timeout: int) -> str: url = self._url_for("web_session_timeout", timeout=timeout) return self._session.patch(url).json() - def get_mac_address_block(self) -> int: - """ - Get the MAC address block. - - :returns: The MAC address block. - """ - url = self._url_for("mac_address_block", block="") - return self._session.get(url).json() - - def set_mac_address_block(self, block: int) -> str: - """ - Set the MAC address block. - - :param block: The MAC address block. - :returns: 'OK' - :raises InvalidMacAddressBlock: If the MAC address block is not in 0-7 range. - """ - if block < 0 or block > 7: - raise InvalidMacAddressBlock - return self._set_mac_address_block(block=block) - - def _set_mac_address_block(self, block: int) -> str: - """Helper method to set the MAC address block.""" - url = self._url_for("mac_address_block", block=block) - return self._session.patch(url).json() - def get_new_compute_host_state(self) -> str: """ Get the admission state of the new compute host.