From cf49722e78474e5faeba253d88e39fe10e1edb66 Mon Sep 17 00:00:00 2001 From: Peter Razumovsky Date: Thu, 3 Mar 2016 15:36:12 +0300 Subject: [PATCH] Fix error msg for wrong auth_url in functional If auth_url config is specified without version, functional tests raises IndexError with message 'list out of range'. Need to add check for auth_url and if it's set incorrectly, raise correct error with message about wrong auth_url config. Change-Id: I78626530138e76ebf43cd186bacac83f1ff48b41 Closes-bug: #1552325 --- heat_integrationtests/common/clients.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/heat_integrationtests/common/clients.py b/heat_integrationtests/common/clients.py index cff3bf261f..85bfea5429 100644 --- a/heat_integrationtests/common/clients.py +++ b/heat_integrationtests/common/clients.py @@ -14,6 +14,7 @@ import os from ceilometerclient import client as ceilometer_client from cinderclient import client as cinder_client +from heat.common.i18n import _ from heatclient import client as heat_client from keystoneclient.auth.identity.generic import password from keystoneclient import exceptions as kc_exceptions @@ -71,8 +72,13 @@ class ClientManager(object): def __init__(self, conf): self.conf = conf - self.v2_auth_url = self.conf.auth_url.replace('/v3', '/v2.0') - self.auth_version = self.conf.auth_url.split('/v')[1] + if self.conf.auth_url.find('/v'): + self.v2_auth_url = self.conf.auth_url.replace('/v3', '/v2.0') + self.auth_version = self.conf.auth_url.split('/v')[1] + else: + raise ValueError(_('Incorrectly specified auth_url config: no ' + 'version found.')) + self.identity_client = self._get_identity_client() self.orchestration_client = self._get_orchestration_client() self.compute_client = self._get_compute_client()