From 9cdf1baccd19ef944923e8dfb520b65c2e9eb5d3 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Tue, 25 Sep 2018 09:21:41 +0000 Subject: [PATCH] Get glance v1 client for icehouse. Previously the image virt type was qemu and the compute node virt type was kvm. This works for deployments prior to rocky but in rocky this causes the image type filter to return no valid hosts. An update to charmhelpers has removed the default behaviour of setting the virt type to 'qemu' by default. Due to a bug in icehouse updating glance image properties using the v2 api fails (See Bug #1371559) so for icehouse deploys get a v1 client. Change-Id: I20548118092a4480f37c7ab7e9d60e72e299989b --- tests/basic_deployment.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index 3fda5232..19761e96 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -192,8 +192,18 @@ class NovaCCBasicDeployment(OpenStackAmuletDeployment): self.keystone_sentry, openstack_release=self._get_openstack_release()) + force_v1_client = False + if self._get_openstack_release() == self.trusty_icehouse: + # Updating image properties (such as arch or hypervisor) using the + # v2 api in icehouse results in: + # https://bugs.launchpad.net/python-glanceclient/+bug/1371559 + u.log.debug('Forcing glance to use v1 api') + force_v1_client = True + # Authenticate admin with glance endpoint - self.glance = u.authenticate_glance_admin(self.keystone) + self.glance = u.authenticate_glance_admin( + self.keystone, + force_v1_client=force_v1_client) # Authenticate admin with nova endpoint self.nova = nova_client.Client(2, session=self.keystone_session)