summaryrefslogtreecommitdiffstats
path: root/ocata/ocata/resource/views/events.py
diff options
context:
space:
mode:
Diffstat (limited to 'ocata/ocata/resource/views/events.py')
-rw-r--r--ocata/ocata/resource/views/events.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/ocata/ocata/resource/views/events.py b/ocata/ocata/resource/views/events.py
index 3cfdad4a..4b477a75 100644
--- a/ocata/ocata/resource/views/events.py
+++ b/ocata/ocata/resource/views/events.py
@@ -44,16 +44,19 @@ class EventsCheck(APIView):
try :
resource_demand = request.data
+ tenant_name = None
+ vim = VimDriverUtils.get_vim_info(vimid)
+ sess = VimDriverUtils.get_session(vim, tenant_name)
+
# get token:
cloud_owner, regionid = extsys.decode_vim_id(vimid)
interface = 'public'
service = {'service_type': 'compute',
'interface': interface,
- 'region_id': regionid}
+ 'region_id': vim['openstack_region_id']
+ if vim.get('openstack_region_id')
+ else vim['cloud_region_id']}
- tenant_name = None
- vim = VimDriverUtils.get_vim_info(vimid)
- sess = VimDriverUtils.get_session(vim, tenant_name)
# get servers detail info
req_resouce = "/servers/detail"