summaryrefslogtreecommitdiff
path: root/cloudinit/sources/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/sources/__init__.py')
-rw-r--r--cloudinit/sources/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/sources/__init__.py b/cloudinit/sources/__init__.py
index a319322b..e6baf8f4 100644
--- a/cloudinit/sources/__init__.py
+++ b/cloudinit/sources/__init__.py
@@ -568,7 +568,7 @@ class DataSource(object):
defhost = "localhost"
domain = defdomain
- if not self.metadata or 'local-hostname' not in self.metadata:
+ if not self.metadata or not self.metadata.get('local-hostname'):
if metadata_only:
return None
# this is somewhat questionable really.