diff options
Diffstat (limited to 'share/newton_base/openoapi/flavor.py')
-rw-r--r-- | share/newton_base/openoapi/flavor.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/share/newton_base/openoapi/flavor.py b/share/newton_base/openoapi/flavor.py index af811f67..18a13987 100644 --- a/share/newton_base/openoapi/flavor.py +++ b/share/newton_base/openoapi/flavor.py @@ -63,6 +63,11 @@ class Flavors(APIView): vim = VimDriverUtils.get_vim_info(vimid) sess = VimDriverUtils.get_session(vim, tenantid) + + self.service['region_id'] = vim['openstack_region_id'] \ + if vim.get('openstack_region_id') \ + else vim['cloud_region_id'] + resp = self._get_flavor(sess, request, flavorid) content = resp.json() @@ -187,6 +192,10 @@ class Flavors(APIView): vim = VimDriverUtils.get_vim_info(vimid) sess = VimDriverUtils.get_session(vim, tenantid) + self.service['region_id'] = vim['openstack_region_id'] \ + if vim.get('openstack_region_id') \ + else vim['cloud_region_id'] + #check if the flavor is already created: name or id tmpresp = self._get_flavor(sess, request) content = tmpresp.json() @@ -329,6 +338,10 @@ class Flavors(APIView): vim = VimDriverUtils.get_vim_info(vimid) sess = VimDriverUtils.get_session(vim, tenantid) + self.service['region_id'] = vim['openstack_region_id'] \ + if vim.get('openstack_region_id') \ + else vim['cloud_region_id'] + #delete extra specs one by one resp = self._delete_flavor_extra_specs(sess, flavorid) |