From 993af3bb07dc817fab7145337acc149fa04561e1 Mon Sep 17 00:00:00 2001 From: Hashir Mohammed Date: Fri, 10 Mar 2017 06:54:19 -0500 Subject: [PATCH] CAL refactor- Bug fix Reviewer: Anirudha Signed-off-by: Hashir Mohammed --- .../rift/rwcal/openstack/utils/compute.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/utils/compute.py b/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/utils/compute.py index d7658dad..55ece65c 100644 --- a/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/utils/compute.py +++ b/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/utils/compute.py @@ -520,9 +520,16 @@ class ComputeUtils(object): console_url(string): Console URL for VM """ console_url = None - if self._parse_vdu_state_info(vm_info) == 'ACTIVE': + if self._parse_vdu_state_info(vm_info) == 'active': try: console_url = self.driver.nova_server_console(vm_info['id']) + serv_console_url = self.driver.nova_server_console(vm_info['id']) + if 'console' in serv_console_url: + console_url = serv_console_url['console']['url'] + else: + self.log.error("Error fetching console url. This could be an Openstack issue. Console : " + str(serv_console_url)) + + except Exception as e: self.log.exception("Exception %s occured during volume list parsing", str(e)) return console_url -- 2.25.1