From f38a2047731530dfa796056c6b1a07d2a9158e66 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Wed, 11 Feb 2015 10:33:00 +0000 Subject: Fix reference to non-existent variable. --- cloudinit/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cloudinit/util.py') diff --git a/cloudinit/util.py b/cloudinit/util.py index b845adfd..d63b4bf2 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -1481,8 +1481,8 @@ def mount_cb(device, callback, data=None, rw=False, mtype=None, sync=True): device, mtype, exc) pass if not mountpoint: - raise MountFailedError("Failed mounting %s to %s due to: %s" % - (device, tmpd, exc)) + raise MountFailedError( + "Failed mounting %s to %s".format(device, tmpd)) # Be nice and ensure it ends with a slash if not mountpoint.endswith("/"): -- cgit v1.2.3 From 85953f737b77b55a0fbe160b158f2ce77730e523 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Wed, 11 Feb 2015 17:24:08 +0000 Subject: Open /dev/console in text mode (so we don't have to encode strings to write them). --- cloudinit/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cloudinit/util.py') diff --git a/cloudinit/util.py b/cloudinit/util.py index d63b4bf2..fe606f23 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -404,7 +404,7 @@ def multi_log(text, console=True, stderr=True, if console: conpath = "/dev/console" if os.path.exists(conpath): - with open(conpath, 'wb') as wfh: + with open(conpath, 'w') as wfh: wfh.write(text) wfh.flush() else: -- cgit v1.2.3 From 587387cfbff7a89573128dc958df903d1becbde1 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 11 Feb 2015 13:58:23 -0500 Subject: include exception in error again. it is admittedly not clear, but 'exc' should be definied if mountpoint is not. --- cloudinit/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cloudinit/util.py') diff --git a/cloudinit/util.py b/cloudinit/util.py index fe606f23..67ea5553 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -1481,8 +1481,8 @@ def mount_cb(device, callback, data=None, rw=False, mtype=None, sync=True): device, mtype, exc) pass if not mountpoint: - raise MountFailedError( - "Failed mounting %s to %s".format(device, tmpd)) + raise MountFailedError("Failed mounting %s to %s due to: %s" % + (device, tmpd, exc)) # Be nice and ensure it ends with a slash if not mountpoint.endswith("/"): -- cgit v1.2.3