Fix py35 python tests

In python3, dict.values() is a dictview, which cannot be indexed.

This change also makes the tox py35 job voting and adds it to the gate
jobs.

Change-Id: I925e53c2e20a75fef1a942003f5e61f6bfeedcdc
Story: #2001637
Task: #6646
This commit is contained in:
Mark Goddard 2018-02-22 11:59:13 +00:00
parent 2acd8a25b2
commit ab5938065f
2 changed files with 4 additions and 5 deletions

View File

@ -382,7 +382,7 @@ class SeedHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
if not hostvars:
self.app.LOG.error("No hosts in the seed group")
sys.exit(1)
hostvars = hostvars.values()[0]
hostvars = list(hostvars.values())[0]
ansible_user = hostvars.get("kayobe_ansible_user")
if not ansible_user:
self.app.LOG.error("Could not determine kayobe_ansible_user "
@ -674,7 +674,7 @@ class OvercloudHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
if not hostvars:
self.app.LOG.error("No hosts in the overcloud group")
sys.exit(1)
hostvars = hostvars.values()[0]
hostvars = list(hostvars.values())[0]
ansible_user = hostvars.get("kayobe_ansible_user")
if not ansible_user:
self.app.LOG.error("Could not determine kayobe_ansible_user "

View File

@ -4,9 +4,7 @@
jobs:
- openstack-tox-pep8
- openstack-tox-py27
# FIXME(mgoddard): python 3.5 jobs currently failing.
- openstack-tox-py35:
voting: false
- openstack-tox-py35
- build-openstack-sphinx-docs
- kayobe-tox-ansible-syntax
- kayobe-tox-ansible
@ -16,6 +14,7 @@
jobs:
- openstack-tox-pep8
- openstack-tox-py27
- openstack-tox-py35
- build-openstack-sphinx-docs
- kayobe-tox-ansible-syntax
- kayobe-tox-ansible