summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-09-03 13:18:23 -0400
committerScott Moser <smoser@ubuntu.com>2014-09-03 13:18:23 -0400
commit141a8329d7650b1e9c80364f289b7f399477e5fc (patch)
tree4a55d96d1210836f8a9609d2ab3d521e6bc5e6a8
parent128fd80cb0b27430def29bee7a8c473facd84be8 (diff)
parent7dade55ae5e429e0abb1687fb94799226c211e18 (diff)
downloadvyos-cloud-init-141a8329d7650b1e9c80364f289b7f399477e5fc.tar.gz
vyos-cloud-init-141a8329d7650b1e9c80364f289b7f399477e5fc.zip
Datasource: fix to provide local-hostname if not available in datasource
-rw-r--r--ChangeLog2
-rw-r--r--cloudinit/sources/__init__.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8a938c37..71ae0d59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,8 @@
- no longer use pylint as a checker, fix pep8 [Jay Faulkner].
- Openstack: do not load some urls twice.
- FreeBsd: fix initscripts and add working config file [Harm Weites]
+ - Datasource: fix broken logic to provide hostname if datasource does not
+ provide one
0.7.5:
- open 0.7.5
- Add a debug log message around import failures
diff --git a/cloudinit/sources/__init__.py b/cloudinit/sources/__init__.py
index 7d52a2e6..a2a8f492 100644
--- a/cloudinit/sources/__init__.py
+++ b/cloudinit/sources/__init__.py
@@ -66,7 +66,7 @@ class DataSource(object):
name = name[0:-3]
self.ds_cfg = util.get_cfg_by_path(self.sys_cfg,
- ("datasource", name), {})
+ ("datasource", name), {})
if not ud_proc:
self.ud_proc = ud.UserDataProcessor(self.paths)
else:
@@ -166,7 +166,7 @@ class DataSource(object):
defhost = "localhost"
domain = defdomain
- if self.metadata or 'local-hostname' not in self.metadata:
+ if not self.metadata or 'local-hostname' not in self.metadata:
# this is somewhat questionable really.
# the cloud datasource was asked for a hostname
# and didn't have one. raising error might be more appropriate