Skip to content

Commit

Permalink
Merge pull request avocado-framework#2883 from PaulYuuu/pflash_empty_…
Browse files Browse the repository at this point in the history
…images

qcontainer: Allow empty image in pflash_handler
  • Loading branch information
YongxueHong authored Jan 14, 2021
2 parents 2d9c69a + bfcac2f commit 52fd538
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions virttest/qemu_devices/qcontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,10 @@ def pflash_handler(firmware_name, cmd):
"""
machine_cmd = cmd
devs = []
images = params.objects('images')

firmware_path = params.get(firmware_name + "_path")
if firmware_path:
if firmware_path and images:
if not os.path.exists(firmware_path):
raise exceptions.TestError("The firmware path is not exist."
" Maybe you need to install "
Expand All @@ -1035,7 +1037,7 @@ def pflash_handler(firmware_name, cmd):
pflash_vars_filename)

# To ignore the influence from backends
first_image = params.objects('images')[0]
first_image = images[0]
img_params = params.object_params(first_image)
img_params["backing_chain"] = "no"
path = storage.get_image_filename_filesytem(img_params,
Expand Down

0 comments on commit 52fd538

Please sign in to comment.