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

Commit

Permalink
Added validation activities when TaskValidationError is raised
Browse files Browse the repository at this point in the history
  • Loading branch information
brdw87 committed Aug 28, 2024
1 parent 0e0394d commit 58fa6b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 58fa6b8

Please sign in to comment.