Tempest config doesn't allow None values

Bug #1863945 reported by Daniel Lutton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rally
Fix Released
Undecided
Daniel Lutton

Bug Description

The below command works in python2.7, however in python3.7 this error is introduced.
This has been traced down to an issue with how the python3.7 builtin configparser works (confirmed with @andreykurilin on gitter).

https://docs.python.org/3.7/library/configparser.html it states "allow_no_value, default value: False", so I'm passing that value as true would resolve this issue.

https://github.com/openstack/rally-openstack/blob/master/rally_openstack/verification/tempest/config.py#L46

self.conf = configparser.ConfigParser()

should be changed to

self.conf = configparser.ConfigParser(allow_no_value=True)

Command:
rally verify start --id tempest_verifier --pattern set=identity --detailed --deployment-id os_deployment

Results from command:
error: 2020-02-18 23:29:45.243 9724 INFO rally.api [-] Configuring verifier 'tempest_verifier' (UUID=07f3fd49-6771-4bfc-a8ec-f8707f75cfd3) for deployment 'os_deployment' (UUID=1eb3d732-fb10-47ab-81c7-a28a1d487e4b). option values must be strings

Results from command with -debug:
09:42:46.702 14432 RALLYDEBUG rally.api [-] INFO logs from urllib3 and requests module are hide.
2020-02-19 09:42:46.703 14432 RALLYDEBUG rally.api [-] urllib3 insecure warnings are hidden.
2020-02-19 09:42:46.703 14432 RALLYDEBUG rally.api [-] ERROR log from boto module is hide.
2020-02-19 09:42:48.071 14432 INFO rally.api [-] Configuring verifier 'tempest_verifier' (UUID=3d619624-45cb-4f75-a148-4980da42eef0) for deployment 'os_deployment' (UUID=6a391481-e088-42c9-9457-3d75940909fe).
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils [-] Unexpected exception in CLI: TypeError: option values must be strings
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils Traceback (most recent call last):
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/local/lib/python3.7/dist-packages/rally/cli/cliutils.py", line 674, in run
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils ret = fn(*fn_args, **fn_kwargs)
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "</usr/local/lib/python3.7/dist-packages/decorator.py:decorator-gen-93>", line 2, in start
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/local/lib/python3.7/dist-packages/rally/cli/envutils.py", line 68, in default_from_global
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils return f(*args, **kwargs)
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "</usr/local/lib/python3.7/dist-packages/decorator.py:decorator-gen-92>", line 2, in start
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/local/lib/python3.7/dist-packages/rally/cli/envutils.py", line 68, in default_from_global
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils return f(*args, **kwargs)
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "</usr/local/lib/python3.7/dist-packages/decorator.py:decorator-gen-91>", line 2, in start
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/local/lib/python3.7/dist-packages/rally/plugins/__init__.py", line 51, in ensure_plugins_are_loaded
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils return f(*args, **kwargs)
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/local/lib/python3.7/dist-packages/rally/cli/commands/verify.py", line 519, in start
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils tags=tags, **run_args)
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/local/lib/python3.7/dist-packages/rally/api.py", line 1016, in start
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils deployment_id=deployment_id)
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/local/lib/python3.7/dist-packages/rally/api.py", line 860, in configure
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils raw_config = vm.configure(extra_options=extra_options)
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/local/lib/python3.7/dist-packages/rally_openstack/verification/tempest/manager.py", line 107, in configure
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils return tcm.create(self.configfile, extra_options)
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/local/lib/python3.7/dist-packages/rally_openstack/verification/tempest/config.py", line 211, in create
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils method()
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/local/lib/python3.7/dist-packages/rally_openstack/verification/tempest/config.py", line 75, in _configure_identity 2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils self.credential.region_name)
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/lib/python3.7/configparser.py", line 1197, in set
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils self._validate_value_types(option=option, value=value)
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils File "/usr/lib/python3.7/configparser.py", line 1182, in _validate_value_types

Daniel Lutton @dlutton 01:50
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils raise TypeError("option values must be strings")
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils TypeError: option values must be strings
2020-02-19 09:42:48.179 14432 ERROR rally.cli.cliutils

The error indicates an issue with self.credential.region_name. When I include this value as a credential, the rally command works. With python2.7 this parameter could be left out, however now it's required.

Daniel Lutton (dlutton)
Changed in rally:
assignee: nobody → Daniel Lutton (dlutton)
status: New → In Progress
Daniel Lutton (dlutton)
Changed in rally:
status: In Progress → Fix Released
Revision history for this message
Daniel Lutton (dlutton) wrote :

This error is still being thrown:
lib/python3.7/site-packages/rally_openstack/verification/tempest/context.py", line 60, in setup

Changed in rally:
status: Fix Released → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to rally-openstack (master)

Fix proposed to branch: master
Review: https://review.opendev.org/711361

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to rally-openstack (master)

Reviewed: https://review.opendev.org/711361
Committed: https://git.openstack.org/cgit/openstack/rally-openstack/commit/?id=3e487073df6d2a588ec2e722c13570a91aefcfbf
Submitter: Zuul
Branch: master

commit 3e487073df6d2a588ec2e722c13570a91aefcfbf
Author: dlutton <email address hidden>
Date: Wed Mar 4 15:11:45 2020 -0800

    Allowing None values in the config parser

    Closes-Bug: #1863945
    Change-Id: Iac06fd64b4365aa29c0b06df6142a8c0851f6d22

Changed in rally:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.