Merge "Create a loop for defining image configuration option"

This commit is contained in:
Zuul 2019-07-05 14:09:12 +00:00 committed by Gerrit Code Review
commit b1cb97f335

View File

@ -28,19 +28,21 @@ def register_tobiko_options(conf):
help=("Default directory where to look for image " help=("Default directory where to look for image "
"files")), ]) "files")), ])
conf.register_opts( for name in ['CirrOS']:
group=cfg.OptGroup('cirros'), group_name = name.lower()
opts=[cfg.StrOpt('image_name', conf.register_opts(
help="Default CirrOS image name"), group=cfg.OptGroup(group_name),
cfg.StrOpt('image_url', opts=[cfg.StrOpt('image_name',
help="Default CirrOS image URL"), help="Default " + name + " image name"),
cfg.StrOpt('image_file', cfg.StrOpt('image_url',
help="Default CirrOS image filename"), help="Default " + name + " image URL"),
cfg.StrOpt('container_format', cfg.StrOpt('image_file',
help="Default CirrOS container format"), help="Default " + name + " image filename"),
cfg.StrOpt('disk_format', cfg.StrOpt('container_format',
help="Default CirrOS disk format"), help="Default " + name + " container format"),
cfg.StrOpt('username', cfg.StrOpt('disk_format',
help="Default CirrOS username"), help="Default " + name + " disk format"),
cfg.StrOpt('password', cfg.StrOpt('username',
help="Default CirrOS password"), ]) help="Default " + name + " username"),
cfg.StrOpt('password',
help="Default " + name + " password"), ])