diff options
author | Mark Goddard <mark@stackhpc.com> | 2019-11-13 18:21:29 +0000 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2019-11-13 11:21:29 -0700 |
commit | 0469f70c8fde69cfbcbc7181a69964aafba50bbc (patch) | |
tree | f830362238a11ef9aed5a824b2297df353a8f97d /cloudinit/sources/__init__.py | |
parent | 6214a57ede3bf0bc098b9c2827f61225a9498f33 (diff) | |
download | vyos-cloud-init-0469f70c8fde69cfbcbc7181a69964aafba50bbc.tar.gz vyos-cloud-init-0469f70c8fde69cfbcbc7181a69964aafba50bbc.zip |
Fix metadata check when local-hostname is null (#32)
Fix traceback when running with a config drive containing a metadata file which has
local-hostname set to null. Cloud-init ignores absent local-hostname or None values.
LP: #1852100
Diffstat (limited to 'cloudinit/sources/__init__.py')
-rw-r--r-- | cloudinit/sources/__init__.py | 2 |
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. |