Skip to content

Commit

Permalink
fixed a typo in upgrades unit test, changed response in deployment re…
Browse files Browse the repository at this point in the history
…quest to be the entire response so it can be piped into wait_for_task. This doesn't seem to break anything else in the library but could break code in the wild, but I believe returning the full response from a deployment request to be worth the cost
  • Loading branch information
Zachery Lantz committed Apr 25, 2024
1 parent 6284b9e commit d540004
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def post(self):
response = self.fmc.send_to_api(
method="post", url=self.URL, json_data=json_data
)
return response["deviceList"]
return response

def put(self):
"""PUT method for API for DeploymentRequests not supported."""
Expand Down
5 changes: 3 additions & 2 deletions unit_tests/upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def test__upgrades(fmc):

# logging.info(f"Upgrade completed. Triggering deployment to devices")
# deployment = fmcapi.DeploymentRequests(fmc=fmc)
# logging.info(deployment)
# wait_for_task(fmc=fmc, task=deployment["metadata"]["task"], wait_time=60)
# response = deployment.post()
# logging.info(response)
# wait_for_task(fmc=fmc, task=response["metadata"]["task"], wait_time=60)

logging.info("Test UpgradePackages/ApplicableDevices/Upgrades Complete")
2 changes: 1 addition & 1 deletion unit_tests/wait_for_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def wait_for_task(fmc, task, wait_time=10):
task_completed_states = ["Success", "SUCCESS", "COMPLETED"]
task_completed_states = ["Success", "SUCCESS", "COMPLETED", "Deployed"]
try:
status = fmcapi.TaskStatuses(fmc=fmc, id=task["id"])
current_status = status.get()
Expand Down

0 comments on commit d540004

Please sign in to comment.