diff --git a/node-daemon/pvcnoded/MetadataAPIInstance.py b/node-daemon/pvcnoded/MetadataAPIInstance.py index 87fc4f07..6fc69af6 100644 --- a/node-daemon/pvcnoded/MetadataAPIInstance.py +++ b/node-daemon/pvcnoded/MetadataAPIInstance.py @@ -152,8 +152,11 @@ class MetadataAPIInstance(object): cur.execute(query, args) data_raw = cur.fetchone() self.close_database(conn, cur) - data = data_raw.get('userdata', None) - return data + if data_raw is not None: + data = data_raw.get('userdata', None) + return data + else: + return None # VM details function def get_vm_details(self, source_address):