delete_all_pnor_images: Call Delete Image and Verify
The delete_all_pnor_images() was calling the method Delete, but we
already have a function to delete images and also verify they got
deleted, so call that one instead to have the verification done
for free.
Tested: Verified by calling REST_Host_Code_Update
with DELETE_OLD_PNOR_IMAGES set to true.
Change-Id: I8c177c6a99c6b62ebae1aa26fb9f1edc4a16fb20
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/lib/code_update_utils.py b/lib/code_update_utils.py
index 3110ddb..0ade9fb 100644
--- a/lib/code_update_utils.py
+++ b/lib/code_update_utils.py
@@ -74,15 +74,13 @@
Delete all PNOR images from the BMC.
"""
+ keyword.run_key("Initiate Host PowerOff")
+
status, images = keyword.run_key("Get Software Objects "
+ var.VERSION_PURPOSE_HOST)
for image_name in images:
- BuiltIn().log_to_console(image_name)
- # Delete twice, in case the image is in the /tmp/images directory
- keyword.run_key("Call Method " + image_name + '/'
- + " Delete data={\"data\":[]}")
- keyword.run_key("Call Method " + image_name + '/'
- + " Delete data={\"data\":[]}")
+ keyword.run_key("Delete Image And Verify " + image_name + " "
+ + var.VERSION_PURPOSE_HOST)
def wait_for_activation_state_change(version_id, initial_state):