summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--multivimbroker/multivimbroker/pub/msapi/extsys.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/multivimbroker/multivimbroker/pub/msapi/extsys.py b/multivimbroker/multivimbroker/pub/msapi/extsys.py
index a76d56a..d925a86 100644
--- a/multivimbroker/multivimbroker/pub/msapi/extsys.py
+++ b/multivimbroker/multivimbroker/pub/msapi/extsys.py
@@ -12,6 +12,7 @@
import json
import logging
+import re
from multivimbroker.pub.exceptions import VimBrokerException
from multivimbroker.pub.utils import restcall
@@ -46,9 +47,9 @@ def encode_vim_id(cloud_owner, cloud_region_id):
def decode_vim_id(vim_id):
- # m = re.search(r'^([0-9a-zA-Z-]+)_([0-9a-zA-Z_-]+)$', vim_id)
- # cloud_owner, cloud_region_id = m.group(1), m.group(2)
- return split_vim_to_owner_region(vim_id)
+ m = re.search(r'^([0-9a-zA-Z-]+)_([0-9a-zA-Z_-]+)$', vim_id)
+ cloud_owner, cloud_region_id = m.group(1), m.group(2)
+ return cloud_owner, cloud_region_id
def split_vim_to_owner_region(vim_id):
@@ -65,7 +66,7 @@ def get_vim_by_id(vim_id):
"version": "4.0",
"vimId": vim_id
}
- cloud_owner, cloud_region = split_vim_to_owner_region(vim_id)
+ cloud_owner, cloud_region = decode_vim_id(vim_id)
ret = restcall.get_res_from_aai("/cloud-infrastructure/cloud-regions/"
"cloud-region/%s/%s" % (
cloud_owner, cloud_region))