summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2016-08-23 16:48:33 -0400
committerScott Moser <smoser@brickies.net>2016-08-23 16:48:33 -0400
commitb25f18328dcb5030b6b52bab0702833d96171358 (patch)
treee737439484df2a5a3f0a0a3a3e2e3fa4228c3dea
parent96ae4fa29fa2f8b2ef886187d48f6c6189287eee (diff)
downloadcloud-init-git-b25f18328dcb5030b6b52bab0702833d96171358.tar.gz
Import version 0.6.3-0ubuntu1.13ubuntu/0.6.3-0ubuntu1.13
Imported using git-dsc-commit.
-rw-r--r--debian/changelog7
-rw-r--r--debian/patches/lp-1302229-fix_futils_azure.patch107
-rw-r--r--debian/patches/series1
3 files changed, 115 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 2538fa7a..37fcf35c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+cloud-init (0.6.3-0ubuntu1.13) precise-proposed; urgency=medium
+
+ * debian/patches/lp-1302229-fix_futils_azure.patch: fixed imports and
+ util usage for new disk detection and format w/ Azure DS (LP: #1302229).
+
+ -- Ben Howard <ben.howard@ubuntu.com> Thu, 03 Apr 2014 16:26:50 -0600
+
cloud-init (0.6.3-0ubuntu1.12) precise-proposed; urgency=low
* debian/patches/lp-1269626-azure_new_instance.patch: fix handling of new
diff --git a/debian/patches/lp-1302229-fix_futils_azure.patch b/debian/patches/lp-1302229-fix_futils_azure.patch
new file mode 100644
index 00000000..0295fcda
--- /dev/null
+++ b/debian/patches/lp-1302229-fix_futils_azure.patch
@@ -0,0 +1,107 @@
+Author: Ben Howard <ben.howard@ubuntu.com>
+Bug: https://launchpad.net/bugs/1302229
+Applied-Upstream: N/A
+Description: fixed imports and util usage for new disk detection and
+ format w/ Azure DS (LP: #1302229).
+--- a/cloudinit/DataSourceAzure.py
++++ b/cloudinit/DataSourceAzure.py
+@@ -284,9 +284,9 @@ def support_new_ephemeral(cfg):
+ # race conditions could allow for a check-then-unmount
+ # to have a false positive. so just unmount and then check.
+ try:
+- util.subp(['umount', device])
+- except util.ProcessExecutionError as e:
+- if device in util.mounts():
++ futil.subp(['umount', device])
++ except futil.ProcessExecutionError as e:
++ if device in futil.mounts():
+ LOG.warn("Failed to unmount %s, will not reformat.", device)
+ LOG.debug("Failed umount: %s", e)
+ return None
+--- a/cloudinit/future_util.py
++++ b/cloudinit/future_util.py
+@@ -3,6 +3,8 @@ import os.path
+ import subprocess
+ import types
+
++from StringIO import StringIO
++
+ LOG = logging.getLogger(__name__)
+
+
+@@ -163,3 +165,75 @@ def del_file(path):
+ if e.errno != errno.ENOENT:
+ raise e
+
++
++def pipe_in_out(in_fh, out_fh, chunk_size=1024, chunk_cb=None):
++ bytes_piped = 0
++ while True:
++ data = in_fh.read(chunk_size)
++ if data == '':
++ break
++ else:
++ out_fh.write(data)
++ bytes_piped += len(data)
++ if chunk_cb:
++ chunk_cb(bytes_piped)
++ out_fh.flush()
++ return bytes_piped
++
++
++def load_file(fname, read_cb=None, quiet=False):
++ LOG.debug("Reading from %s (quiet=%s)", fname, quiet)
++ ofh = StringIO()
++ try:
++ with open(fname, 'rb') as ifh:
++ pipe_in_out(ifh, ofh, chunk_cb=read_cb)
++ except IOError as e:
++ if not quiet:
++ raise
++ if e.errno != errno.ENOENT:
++ raise
++ contents = ofh.getvalue()
++ LOG.debug("Read %s bytes from %s", len(contents), fname)
++ return contents
++
++
++def mounts():
++ mounted = {}
++ try:
++ # Go through mounts to see what is already mounted
++ if os.path.exists("/proc/mounts"):
++ mount_locs = load_file("/proc/mounts").splitlines()
++ method = 'proc'
++ else:
++ (mountoutput, _err) = subp("mount")
++ mount_locs = mountoutput.splitlines()
++ method = 'mount'
++ mountre = r'^(/dev/[\S]+) on (/.*) \((.+), .+, (.+)\)$'
++ for mpline in mount_locs:
++ # Linux: /dev/sda1 on /boot type ext4 (rw,relatime,data=ordered)
++ # FreeBSD: /dev/vtbd0p2 on / (ufs, local, journaled soft-updates)
++ try:
++ if method == 'proc':
++ (dev, mp, fstype, opts, _freq, _passno) = mpline.split()
++ else:
++ m = re.search(mountre, mpline)
++ dev = m.group(1)
++ mp = m.group(2)
++ fstype = m.group(3)
++ opts = m.group(4)
++ except:
++ continue
++ # If the name of the mount point contains spaces these
++ # can be escaped as '\040', so undo that..
++ mp = mp.replace("\\040", " ")
++ mounted[dev] = {
++ 'fstype': fstype,
++ 'mountpoint': mp,
++ 'opts': opts,
++ }
++ LOG.debug("Fetched %s mounts from %s", mounted, method)
++ except (IOError, OSError):
++ logexc(LOG, "Failed fetching mount points")
++ return mounted
++
++
diff --git a/debian/patches/series b/debian/patches/series
index e0172871..98cbabad 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -21,3 +21,4 @@ lp-1272115-fix_smartos_compliance.patch
lp-1244355-cloudarchive.patch
lp-1269626-azure_new_instance.patch
lp-1292648-azure-format-ephemeral-new.patch
+lp-1302229-fix_futils_azure.patch