Fix compute and volume endpoint discovery
The endpoint discovery mechanism in compute and volume use no_port_cut_url to cut the URLs after the version (including the version) if port is not present. However, when the port is present, the no_port_cut_url method sets the top_level to True when calling do_get method. This causes the do_get method also cut the top_level_path of the URLs because by default the top_level_path is set to "". This behavior is not desired because different clouds maybe have endpoints with different top_level_path other than "". Instead of using no_port_cut_url, we can use utils.get_base_url to properly cut the URLs after and including the version. Story: #2010968 Task: #49109 Change-Id: I221b6267afce90b8b7e22d468f0824c9365f4a91
This commit is contained in:
parent
b5ae1f69ac
commit
aa037e9ce0
@ -19,12 +19,13 @@ from tempest.lib import exceptions
|
||||
|
||||
from config_tempest import constants as C
|
||||
from config_tempest.services.base import VersionedService
|
||||
from config_tempest import utils
|
||||
|
||||
|
||||
class ComputeService(VersionedService):
|
||||
def set_versions(self):
|
||||
url, top_level = self.no_port_cut_url()
|
||||
body = self.do_get(url, top_level=top_level)
|
||||
url_without_version = utils.get_base_url(self.service_url)
|
||||
body = self.do_get(url_without_version, top_level=False)
|
||||
self.versions_body = json.loads(body)
|
||||
self.versions = self.deserialize_versions(self.versions_body)
|
||||
|
||||
|
@ -19,6 +19,7 @@ import re
|
||||
from config_tempest import constants as C
|
||||
from config_tempest.services.base import ServiceError
|
||||
from config_tempest.services.base import VersionedService
|
||||
from config_tempest import utils
|
||||
|
||||
from tempest.lib import exceptions
|
||||
|
||||
@ -30,8 +31,8 @@ class VolumeService(VersionedService):
|
||||
self.extensions = list(map(lambda x: x['alias'], body['extensions']))
|
||||
|
||||
def set_versions(self):
|
||||
url, top_level = self.no_port_cut_url()
|
||||
body = self.do_get(url, top_level=top_level)
|
||||
url_without_version = utils.get_base_url(self.service_url)
|
||||
body = self.do_get(url_without_version, top_level=False)
|
||||
self.versions_body = json.loads(body)
|
||||
self.versions = self.deserialize_versions(self.versions_body)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user