summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Yang <bin.yang@windriver.com>2017-10-24 01:14:07 +0800
committerBin Yang <bin.yang@windriver.com>2017-10-24 01:14:07 +0800
commit93e03868d32458735efa3005b2a2f067622bf11c (patch)
treee6dc607425a2752153be39c104f5321e4a156c34
parentd21c1fe9877aabf07a113f0f50c1b0a74dc04cd1 (diff)
Fix bug of keystone v2.0 API
Change-Id: I3683a867efc5c836b1d842dcdcd8240f4829f9f3 Issue-Id: MULTICLOUD-118 Signed-off-by: Bin Yang <bin.yang@windriver.com>
-rw-r--r--newton/newton/proxy/views/identityV3.py11
-rw-r--r--newton/newton/proxy/views/proxy_utils.py4
2 files changed, 11 insertions, 4 deletions
diff --git a/newton/newton/proxy/views/identityV3.py b/newton/newton/proxy/views/identityV3.py
index bc2b06e9..7395fac8 100644
--- a/newton/newton/proxy/views/identityV3.py
+++ b/newton/newton/proxy/views/identityV3.py
@@ -156,8 +156,14 @@ class TokensV2(Tokens):
}
#convert endpoints
- v2_catalog1_endpoints = {"id": v3_catalog['id']}
+ v2_catalog1_endpoints = None
for v3_endpoint in v3_catalog['endpoints']:
+ v2_catalog1_endpoints = {
+ "id": v3_endpoint['id'],
+ "region":v3_endpoint['region'],
+ "region_id": v3_endpoint['region_id'],
+ 'interface':v3_endpoint['interface']
+ }
if v3_endpoint['interface'] == 'public':
v2_catalog1_endpoints['publicURL'] = v3_endpoint['url']
elif v3_endpoint['interface'] == 'admin':
@@ -165,7 +171,8 @@ class TokensV2(Tokens):
elif v3_endpoint['interface'] == 'internal':
v2_catalog1_endpoints['internalURL'] = v3_endpoint['url']
- v2_catalog1['endpoints'].append(v2_catalog1_endpoints)
+ if v2_catalog1_endpoints:
+ v2_catalog1['endpoints'].append(v2_catalog1_endpoints)
v2_catalog.append(v2_catalog1)
diff --git a/newton/newton/proxy/views/proxy_utils.py b/newton/newton/proxy/views/proxy_utils.py
index c80b9680..68182d4a 100644
--- a/newton/newton/proxy/views/proxy_utils.py
+++ b/newton/newton/proxy/views/proxy_utils.py
@@ -158,13 +158,13 @@ class ProxyUtils(object):
"name":"dns-delegate",
"type":"dns",
"id": str(uuid.uuid1()),
- "endpoints": {
+ "endpoints": [{
"interface": "public",
"region": cloud_dns_delegate_info.get("cloud-region-id"),
"region_id": cloud_dns_delegate_info.get("cloud-region-id"),
"id": str(uuid.uuid1()),
"url": multicould_namespace + "/%s/dns-delegate" % vimid,
- }
+ }]
}
catalog.append(dns_catalog)