commit | 74e760a46e6c2260b6b048271c3b759641290efb | [log] [tgz] |
---|---|---|
author | zheng.yong <yong.zheng@easystack.cn> | Wed May 22 14:16:14 2019 +0800 |
committer | yong.zheng <zhengy23@163.com> | Mon May 27 13:14:14 2019 +0800 |
tree | 83974a9f688341dbf805ae62c17dbc81e9f27eb3 | |
parent | 22c547853e9a786f8849a06fa46e3aa164bdd782 [diff] [blame] |
Normalize url without port with schema default port In function get_bare_url, it will assert url startswith base_url, if base_url is 'http://neutron.openstack.svc.cluster.local:80/', while url is 'http://neutron.openstack.svc.cluster.local/v2.0/router/...', it will raise error. here need to add default schema port 80 to url to fix this problem. Change-Id: I44d623d3d0d96711f7ca93fc24b40c024dd86446 Closes-Bug: #1829962
diff --git a/neutron_tempest_plugin/api/base.py b/neutron_tempest_plugin/api/base.py index 7b91d94..2c062c4 100644 --- a/neutron_tempest_plugin/api/base.py +++ b/neutron_tempest_plugin/api/base.py
@@ -1111,8 +1111,10 @@ def get_bare_url(self, url): base_url = self.client.base_url - self.assertTrue(url.startswith(base_url)) - return url[len(base_url):] + base_url_normalized = utils.normalize_url(base_url) + url_normalized = utils.normalize_url(url) + self.assertTrue(url_normalized.startswith(base_url_normalized)) + return url_normalized[len(base_url_normalized):] @classmethod def _extract_resources(cls, body):