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:
parent
17cd7bac42
commit
d974ffd707
@ -388,9 +388,15 @@ class Component(ComponentBase):
|
|||||||
Args:
|
Args:
|
||||||
image_path: A string, path to firmware image
|
image_path: A string, path to firmware image
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
False if image not found.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
RuntimeError: update failed
|
RuntimeError: update failed
|
||||||
"""
|
"""
|
||||||
|
if not os.path.isfile(image_path):
|
||||||
|
return False
|
||||||
|
|
||||||
valid, version = self._get_available_firmware_version(image_path)
|
valid, version = self._get_available_firmware_version(image_path)
|
||||||
if valid:
|
if valid:
|
||||||
avail_ver = version.get(self.name)
|
avail_ver = version.get(self.name)
|
||||||
|
Reference in New Issue
Block a user