Fix overrides and image_path

The patch fixes the default value of image argument,
which was missing and caused problems in python-tempestconf.
Then the overrides weren't parsed corectly and were not exposed
to python-tempestconf. The patch fixes that too.

Story: 2003787
Task: 26493

Change-Id: Iaeecb838599039067a5b198ec3a08c233dfdac94
This commit is contained in:
Martin Kopec 2018-09-17 14:46:52 +00:00
parent 2d3efc28a5
commit ab8ec0a485
2 changed files with 9 additions and 7 deletions

View File

@ -468,14 +468,15 @@ class RefstackClient:
# of scope of python-tempestconf, adding it hardcoded here as a extra
# overrides.
cinder_overrides = "volume-feature-enabled.api_v2=True"
overrides_format = cinder_overrides.replace('=', ' ').split()
overrides_format = cinder_overrides.replace('=', ',').split(',')
overrides = []
if self.args.overrides:
overrides = self.args.overrides.replace('=', ',').split(',')
if cinder_overrides not in self.args.overrides:
overrides = self.args.overrides.replace('=', ' ').split(',')
extra_overrides = overrides.append(overrides_format)
overrides = overrides + overrides_format
else:
extra_overrides = overrides_format
kwargs.update({'overrides': main.parse_overrides(extra_overrides)})
overrides = overrides_format
kwargs.update({'overrides': main.parse_overrides(overrides)})
# Generate accounts.yaml if accounts.file is not given
if not self.args.test_accounts:
@ -825,6 +826,7 @@ def parse_cli_args(args=None):
action='store',
required=False,
dest='image',
default=C.DEFAULT_IMAGE,
help='An image name chosen from `$ openstack '
'image list` or a filepath/URL of an '
'image to be uploaded to glance and set '

View File

@ -20,8 +20,8 @@
source .venv/bin/activate
{{ source_credentials_commands }}
printenv
refstack-client config --use-test-accounts /etc/openstack/accounts.yaml \
--image http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img \
refstack-client config \
--use-test-accounts /etc/openstack/accounts.yaml \
--out /tmp/tempest.conf
args:
chdir: "{{ refstack_client_src_relative_path }}"