summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceNoCloud.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/sources/DataSourceNoCloud.py')
-rw-r--r--cloudinit/sources/DataSourceNoCloud.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceNoCloud.py b/cloudinit/sources/DataSourceNoCloud.py
index a126aad3..2d9e86b4 100644
--- a/cloudinit/sources/DataSourceNoCloud.py
+++ b/cloudinit/sources/DataSourceNoCloud.py
@@ -247,7 +247,7 @@ def _quick_read_instance_id(dirs=None):
try:
data = util.pathprefix2dict(d, required=['meta-data'])
md = util.load_yaml(data['meta-data'])
- if iid_key in md:
+ if md and iid_key in md:
return md[iid_key]
except ValueError:
pass