Remove basic_auth strategy
The auth strategy selection is removed
since it is confusing and other authentication
methods are not supported.
Re-commit the files, because the previous update is not correct.
Implements: remove basic_auth strategy
Fixes: bug #1180972
Change-Id: I498be0b1e3eeea397e1f164caffe7cc88be0ceda
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 915e2fa..617c016 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -14,9 +14,6 @@
uri = http://127.0.0.1:5000/v2.0/
# URL for where to find the OpenStack V3 Identity API endpoint (Keystone)
uri_v3 = http://127.0.0.1:5000/v3/
-# Should typically be left as keystone unless you have a non-Keystone
-# authentication API service
-strategy = keystone
# The identity region
region = RegionOne
diff --git a/tempest/clients.py b/tempest/clients.py
index e778dc1..a5c7b4d 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -274,22 +274,15 @@
self.auth_url = self.config.identity.uri
self.auth_url_v3 = self.config.identity.uri_v3
- if self.config.identity.strategy == 'keystone':
- client_args = (self.config, self.username, self.password,
- self.auth_url, self.tenant_name)
+ client_args = (self.config, self.username, self.password,
+ self.auth_url, self.tenant_name)
- if self.auth_url_v3:
- auth_version = 'v3'
- client_args_v3_auth = (self.config, self.username,
- self.password, self.auth_url_v3,
- self.tenant_name, auth_version)
- else:
- client_args_v3_auth = None
-
+ if self.auth_url_v3:
+ auth_version = 'v3'
+ client_args_v3_auth = (self.config, self.username,
+ self.password, self.auth_url_v3,
+ self.tenant_name, auth_version)
else:
- client_args = (self.config, self.username, self.password,
- self.auth_url)
-
client_args_v3_auth = None
try:
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index baa3c03..531dfc8 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -51,7 +51,6 @@
self.base_url = None
self.region = {'compute': self.config.identity.region}
self.endpoint_url = 'publicURL'
- self.strategy = self.config.identity.strategy
self.headers = {'Content-Type': 'application/%s' % self.TYPE,
'Accept': 'application/%s' % self.TYPE}
self.build_interval = config.compute.build_interval
@@ -72,21 +71,14 @@
Sets the token and base_url used in requests based on the strategy type
"""
- if self.strategy == 'keystone':
-
- if self.auth_version == 'v3':
- auth_func = self.identity_auth_v3
- else:
- auth_func = self.keystone_auth
-
- self.token, self.base_url = (
- auth_func(self.user, self.password, self.auth_url,
- self.service, self.tenant_name))
-
+ if self.auth_version == 'v3':
+ auth_func = self.identity_auth_v3
else:
- self.token, self.base_url = self.basic_auth(self.user,
- self.password,
- self.auth_url)
+ auth_func = self.keystone_auth
+
+ self.token, self.base_url = (
+ auth_func(self.user, self.password, self.auth_url,
+ self.service, self.tenant_name))
def clear_auth(self):
"""
diff --git a/tempest/config.py b/tempest/config.py
index 85be7a6..7852eba 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -40,10 +40,6 @@
help="Full URI of the OpenStack Identity API (Keystone), v2"),
cfg.StrOpt('uri_v3',
help='Full URI of the OpenStack Identity API (Keystone), v3'),
- cfg.StrOpt('strategy',
- default='keystone',
- help="Which auth method does the environment use? "
- "(basic|keystone)"),
cfg.StrOpt('region',
default='RegionOne',
help="The identity region name to use."),
diff --git a/tempest/manager.py b/tempest/manager.py
index 762bc18..4a447f3 100644
--- a/tempest/manager.py
+++ b/tempest/manager.py
@@ -115,11 +115,8 @@
if 'tokens' not in auth_url:
auth_url = auth_url.rstrip('/') + '/tokens'
- if self.config.identity.strategy == 'keystone':
- client_args = (self.config, username, password, auth_url,
- tenant_name)
- else:
- client_args = (self.config, username, password, auth_url)
+ client_args = (self.config, username, password, auth_url,
+ tenant_name)
self.servers_client = ServersClient(*client_args)
self.flavors_client = FlavorsClient(*client_args)