From 58fa6b87895b28975dac61fa9c1159f1dd36a538 Mon Sep 17 00:00:00 2001 From: Bartlomiej Radwan Date: Wed, 28 Aug 2024 03:32:56 -0700 Subject: [PATCH 1/3] Added validation activities when TaskValidationError is raised --- catalystwan/api/task_status_api.py | 5 ++++- catalystwan/api/template_api.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/catalystwan/api/task_status_api.py b/catalystwan/api/task_status_api.py index 8441a16c..c5ab3929 100644 --- a/catalystwan/api/task_status_api.py +++ b/catalystwan/api/task_status_api.py @@ -38,7 +38,10 @@ def __check_validation_status(self, task: TaskData): if not task.validation: return None if task.validation.status in (OperationStatus.FAILURE, OperationStatus.VALIDATION_FAILURE): - raise TaskValidationError(f"Task status validation failed, validation status is: {task.validation.status}") + raise TaskValidationError( + f"Task status validation failed, validation status is: {task.validation.status}" + f"\n{task.validation.activity}" + ) def wait_for_completed( self, diff --git a/catalystwan/api/template_api.py b/catalystwan/api/template_api.py index 31b5050e..b21d6b6f 100644 --- a/catalystwan/api/template_api.py +++ b/catalystwan/api/template_api.py @@ -193,7 +193,7 @@ def get_device_specific_variables(name: str): task = Task(session=self.session, task_id=response["id"]).wait_for_completed(timeout_seconds=timeout_seconds) if task.result: return True - logger.warning(f"Failed to attach tempate: {name} to the device: {device.hostname}.") + logger.warning(f"Failed to attach template: {name} to the device: {device.hostname}.") logger.warning(f"Task activity information: {task.sub_tasks_data[0].activity}") return False From ccafc438af4ba1f8b890e8326e9a643ae77c1907 Mon Sep 17 00:00:00 2001 From: Bartlomiej Radwan Date: Wed, 28 Aug 2024 22:33:11 -0700 Subject: [PATCH 2/3] Bump up SDK version --- catalystwan/api/admin_tech_api.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/catalystwan/api/admin_tech_api.py b/catalystwan/api/admin_tech_api.py index 1d1d566d..ad3eb62e 100644 --- a/catalystwan/api/admin_tech_api.py +++ b/catalystwan/api/admin_tech_api.py @@ -119,7 +119,7 @@ def generate( response = http_error.response # type: ignore if response.status_code == 200: filename = response.json()["fileName"] - self._get_token_id(filename=filename, timeout=request_timeout, interval=polling_interval) + self._get_tokenn_id(filename=filename, timeout=request_timeout, interval=polling_interval) return filename if response.status_code == 400 and create_admin_tech_error_msgs in response.json().get("error", {}).get( "details", "" diff --git a/pyproject.toml b/pyproject.toml index b8664df9..e48e3557 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "catalystwan" -version = "0.35.0" +version = "0.35.1" description = "Cisco Catalyst WAN SDK for Python" authors = ["kagorski "] readme = "README.md" From 645f7946ebf86e529a7812683eacc86ff25040e5 Mon Sep 17 00:00:00 2001 From: Bartlomiej Radwan Date: Wed, 28 Aug 2024 22:43:18 -0700 Subject: [PATCH 3/3] Corrected typo and trigger update of endpoints doc --- ENDPOINTS.md | 2 +- catalystwan/api/admin_tech_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ENDPOINTS.md b/ENDPOINTS.md index 6fa5b5bc..9cc6262f 100644 --- a/ENDPOINTS.md +++ b/ENDPOINTS.md @@ -1,6 +1,6 @@ **THIS FILE WAS AUTO-GENERATED DO NOT EDIT** -Generated for: catalystwan-0.34.1 +Generated for: catalystwan-0.35.1 All URIs are relative to */dataservice* HTTP request | Supported Versions | Method | Payload Type | Return Type | Tenancy Mode diff --git a/catalystwan/api/admin_tech_api.py b/catalystwan/api/admin_tech_api.py index ad3eb62e..1d1d566d 100644 --- a/catalystwan/api/admin_tech_api.py +++ b/catalystwan/api/admin_tech_api.py @@ -119,7 +119,7 @@ def generate( response = http_error.response # type: ignore if response.status_code == 200: filename = response.json()["fileName"] - self._get_tokenn_id(filename=filename, timeout=request_timeout, interval=polling_interval) + self._get_token_id(filename=filename, timeout=request_timeout, interval=polling_interval) return filename if response.status_code == 400 and create_admin_tech_error_msgs in response.json().get("error", {}).get( "details", ""