Add alternative image to be downloaded

Sometimes the image is being download from some other place rather than
the C.DEFAULT_IMAGE, and then it fails due the fact the url is down.
Add the --alt-image option allows tempestconf to instead of fail, try
again download a different image

Change-Id: Ia1af9e684dc4488841e2b54c5817902e19e51b7f
This commit is contained in:
Arx Cruz
2021-02-11 16:49:39 +01:00
parent 61e47a2b13
commit 506bd27890
4 changed files with 50 additions and 11 deletions

View File

@@ -295,6 +295,10 @@ def get_arg_parser():
glance if it's not already there. The name of
the image is the leaf name of the path. Default
is '%s'""" % C.DEFAULT_IMAGE)
parser.add_argument('--retry-image', default=False, action='store_true',
help="""Allow tempestconf to retry download an image,
in case of failure, from these urls: '%s'
""" % C.DEFAULT_IMAGES)
parser.add_argument('--flavor-min-mem', default=C.DEFAULT_FLAVOR_RAM,
type=int, help="""Specify minimum memory for new
flavours, default is '%s'.""" % C.DEFAULT_FLAVOR_RAM)
@@ -539,7 +543,8 @@ def config_tempest(**kwargs):
no_rng=kwargs.get('no_rng', False),
convert=kwargs.get('convert_to_raw',
False))
image.create_tempest_images(conf)
retry_alt = kwargs.get('retry_image', False)
image.create_tempest_images(conf, retry_alt=retry_alt)
if services.is_service(**{"type": "network"}):
network = services.get_service("network")
@@ -599,7 +604,8 @@ def main():
overrides=args.overrides,
remove=args.remove,
test_accounts=args.test_accounts,
verbose=args.verbose
verbose=args.verbose,
retry_image=args.retry_image
)