DellEMC Z9332f: 'update_firmware' component API return False if firmware image not found (#10797)

Why I did it
To return 'False' in update_firmware component API in DellEMC Z9332f platform, if the firmware image is not present in the provided image path.

How I did it
Updated 'update_firmware' in component.py to return False if image is not found in location provided by 'image_path'

How to verify it
Verified that the API returns False when an invalid image path is specified.
This commit is contained in:
Arun Saravanan Balachandran 2022-06-29 22:00:58 +05:30 committed by GitHub
parent 17cd7bac42
commit d974ffd707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -388,9 +388,15 @@ class Component(ComponentBase):
Args:
image_path: A string, path to firmware image
Returns:
False if image not found.
Raises:
RuntimeError: update failed
"""
if not os.path.isfile(image_path):
return False
valid, version = self._get_available_firmware_version(image_path)
if valid:
avail_ver = version.get(self.name)