From 8521b599fc53a015531dbb5068fb1cb02720b803 Mon Sep 17 00:00:00 2001 From: David Weinholz Date: Tue, 12 Feb 2019 23:57:26 +0100 Subject: [PATCH] feat(volume):updated --- VirtualMachineService/VirtualMachineHandler.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/VirtualMachineService/VirtualMachineHandler.py b/VirtualMachineService/VirtualMachineHandler.py index 570dd224..b45c2d80 100644 --- a/VirtualMachineService/VirtualMachineHandler.py +++ b/VirtualMachineService/VirtualMachineHandler.py @@ -345,9 +345,16 @@ def get_server(self, openstack_id): timestamp = time.mktime(dt.timetuple()) else: timestamp = None - - flav = self.conn.compute.get_flavor(serv['flavor']['id']).to_dict() - img = self.get_Image_with_Tag(serv['image']['id']) + try: + flav = self.conn.compute.get_flavor(serv['flavor']['id']).to_dict() + except Exception as e: + self.logger.error(e) + flav=None + try: + img = self.get_Image_with_Tag(serv['image']['id']) + except Exception as e: + self.logger.error(e) + img = None for values in server.addresses.values(): for address in values: