summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceConfigDrive.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-02-24 20:17:07 -0500
committerScott Moser <smoser@ubuntu.com>2014-02-24 20:17:07 -0500
commit6c5a804e0c0dd815edd8d1422612e5fad9a5180e (patch)
tree326a26758dca98c6282d70a9755d8bec2c103208 /cloudinit/sources/DataSourceConfigDrive.py
parent38ed9efa80d328d30f0a0296471a9dd734b27d23 (diff)
parentecdeff294c9ac5706486467ef68653d21f51b7e5 (diff)
downloadvyos-cloud-init-6c5a804e0c0dd815edd8d1422612e5fad9a5180e.tar.gz
vyos-cloud-init-6c5a804e0c0dd815edd8d1422612e5fad9a5180e.zip
ConfigDrive: trim trailing newlines in previous-instance-id
When cloud-init writes previous-instance-id, it does so with a trailing '\n'. This isn't ideal, as other readers also have to know that this will have a trailing '\n' on it, but here we just trim that off.
Diffstat (limited to 'cloudinit/sources/DataSourceConfigDrive.py')
-rw-r--r--cloudinit/sources/DataSourceConfigDrive.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceConfigDrive.py b/cloudinit/sources/DataSourceConfigDrive.py
index 142e0eb8..0c35f83a 100644
--- a/cloudinit/sources/DataSourceConfigDrive.py
+++ b/cloudinit/sources/DataSourceConfigDrive.py
@@ -181,7 +181,7 @@ def get_previous_iid(paths):
# hasn't declared itself found.
fname = os.path.join(paths.get_cpath('data'), 'instance-id')
try:
- return util.load_file(fname)
+ return util.load_file(fname).rstrip("\n")
except IOError:
return None