Ensure we don't grab None data
This commit is contained in:
parent
ae79113f7c
commit
647bce2a22
|
@ -152,8 +152,11 @@ class MetadataAPIInstance(object):
|
||||||
cur.execute(query, args)
|
cur.execute(query, args)
|
||||||
data_raw = cur.fetchone()
|
data_raw = cur.fetchone()
|
||||||
self.close_database(conn, cur)
|
self.close_database(conn, cur)
|
||||||
|
if data_raw is not None:
|
||||||
data = data_raw.get('userdata', None)
|
data = data_raw.get('userdata', None)
|
||||||
return data
|
return data
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
# VM details function
|
# VM details function
|
||||||
def get_vm_details(self, source_address):
|
def get_vm_details(self, source_address):
|
||||||
|
|
Loading…
Reference in New Issue