Fix: make sure that keystone_v3_support is a boolean

Otherwise the "if keystone_v3_support:" condition is always true
(any non empty string makes the condition True).

Thanks Trevor McCasland for the analysis.

Story: 2003307
Task: 24260

Change-Id: Iab146ccf31a039c888cecb4ac7e820ec55de80a4
This commit is contained in:
Luigi Toscano 2018-08-03 19:19:08 +02:00
parent 3b95b8eacb
commit 1473c7c4b8
1 changed files with 5 additions and 1 deletions

View File

@ -264,7 +264,11 @@ class Services(object):
def set_service_extensions(self):
postfix = "-feature-enabled"
keystone_v3_support = self._conf.get('identity' + postfix, 'api_v3')
try:
keystone_v3_support = self._conf.getboolean('identity' + postfix,
'api_v3')
except ValueError:
keystone_v3_support = False
if keystone_v3_support:
self.get_service('identity').set_identity_v3_extensions()