From ecdeff294c9ac5706486467ef68653d21f51b7e5 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Mon, 24 Feb 2014 14:24:04 -0800 Subject: 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. --- cloudinit/sources/DataSourceConfigDrive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3