Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #807 from cisco-open/add_activity_when_validation_…
Browse files Browse the repository at this point in the history
…failed

Added extra info about validation activities when TaskValidationError is raised
  • Loading branch information
brdw87 authored Aug 29, 2024
2 parents 0e0394d + 645f794 commit 765156d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ENDPOINTS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion catalystwan/api/task_status_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion catalystwan/api/template_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 765156d

Please sign in to comment.