Workaround APPC dependency on compute v2 API 13/21013/1
authorBin Yang <bin.yang@windriver.com>
Fri, 27 Oct 2017 13:38:47 +0000 (21:38 +0800)
committerBin Yang <bin.yang@windriver.com>
Fri, 27 Oct 2017 13:38:47 +0000 (21:38 +0800)
Change-Id: Ia33e6b2b02e8d7d74b781527dd5e0376ce27aa38
Issue-Id: MULTICLOUD-106
Signed-off-by: Bin Yang <bin.yang@windriver.com>
newton/newton/proxy/views/services.py

index 34f3912..19fec9c 100644 (file)
@@ -86,6 +86,12 @@ class Services(APIView):
     def _do_action(self, action, request, vim_id, servicetype, requri):
         tmp_auth_token = self._get_token(request)
         try:
+            #special handling of compute/v2 request from APPC, temp solution for A release
+            if servicetype == 'compute':
+                tmp_pattern = re.compile(r'^v2/(.+)')
+                requri = tmp_pattern.sub(r'v2.1/' + r'\1', requri)
+
+
             vim = VimDriverUtils.get_vim_info(vim_id)
             # fetch the auth_state out of cache
             auth_state, metadata_catalog = VimDriverUtils.get_token_cache(tmp_auth_token)