summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceConfigDrive.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2014-02-24 14:24:04 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-02-24 14:24:04 -0800
commitecdeff294c9ac5706486467ef68653d21f51b7e5 (patch)
tree7217c1f9fa00c5323b1c94076c498234b3a1c1fe /cloudinit/sources/DataSourceConfigDrive.py
parent82c659d5473d4f06705c233bc43f5d5a8ba262f7 (diff)
downloadvyos-cloud-init-ecdeff294c9ac5706486467ef68653d21f51b7e5.tar.gz
vyos-cloud-init-ecdeff294c9ac5706486467ef68653d21f51b7e5.zip
Ensure we strip the previous_iid file contents
The instance-id file contains the instance id and a newline, to compare correctly make sure we strip the newline before further usage.
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..6b79a949 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).strip()
except IOError:
return None