diff -Nru cloud-init-0.7.7~bzr1091/debian/changelog cloud-init-0.7.7~bzr1091/debian/changelog --- cloud-init-0.7.7~bzr1091/debian/changelog 2015-05-25 15:40:18.000000000 +0000 +++ cloud-init-0.7.7~bzr1091/debian/changelog 2015-06-08 19:39:38.000000000 +0000 @@ -1,3 +1,11 @@ +cloud-init (0.7.7~bzr1091-0ubuntu3) vivid-proposed; urgency=medium + + * d/README.source, debian/cherry-pick-rev: improve packaging tool + * fix read_seeded method needed for seeding cloud-init via kernel + command line (LP: #1455233). + + -- Scott Moser Mon, 08 Jun 2015 15:39:32 -0400 + cloud-init (0.7.7~bzr1091-0ubuntu2) vivid; urgency=medium * Backport of 15.10 Azure Datasource to fix various issues: diff -Nru cloud-init-0.7.7~bzr1091/debian/cherry-pick-rev cloud-init-0.7.7~bzr1091/debian/cherry-pick-rev --- cloud-init-0.7.7~bzr1091/debian/cherry-pick-rev 2015-02-26 19:16:35.000000000 +0000 +++ cloud-init-0.7.7~bzr1091/debian/cherry-pick-rev 2015-06-08 19:38:09.000000000 +0000 @@ -23,7 +23,7 @@ name=${name%.patch} name=${name%.diff} -fname="${revno}-${name}.patch" +fname="${name}.patch" ( cd "${repo}" && bzr log -r${revno}..${revno} && bzr diff -p1 -r$((${revno}-1))..${revno} ) | @@ -36,8 +36,9 @@ now, quilt push quilt refresh - files="\$(quilt files ${fname}) debian/patches/series debian/patches/${fname} .pc/${fname} .pc/applied-patches)" - bzr add $files + rm -f .pc/${fname}/.timestamp + files="\$(quilt files ${fname}) debian/patches/series debian/patches/${fname} .pc/${fname} .pc/applied-patches" + bzr add \$files dch --append "${name} (cherry pick $revno)" dch --edit # improve the entry debcommit $files diff -Nru cloud-init-0.7.7~bzr1091/debian/patches/fix-read-seeded.patch cloud-init-0.7.7~bzr1091/debian/patches/fix-read-seeded.patch --- cloud-init-0.7.7~bzr1091/debian/patches/fix-read-seeded.patch 1970-01-01 00:00:00.000000000 +0000 +++ cloud-init-0.7.7~bzr1091/debian/patches/fix-read-seeded.patch 2015-06-08 19:38:54.000000000 +0000 @@ -0,0 +1,130 @@ +------------------------------------------------------------ +revno: 1102 +fixes bug: https://launchpad.net/bugs/1455233 +committer: Scott Moser +branch nick: trunk +timestamp: Thu 2015-05-14 17:06:39 -0400 +message: + read_seeded: fix reed_seeded after regression + + read_seeded was assuming a Response object back from load_tfile_or_url + but load_tfile_or_url was returning string. + + since the only other user of this was a test, move load_tfile_or_url to + a test, and just do the right thing in read_seeded. +=== modified file 'cloudinit/util.py' +--- a/cloudinit/util.py ++++ b/cloudinit/util.py +@@ -766,10 +766,6 @@ def fetch_ssl_details(paths=None): + return ssl_details + + +-def load_tfile_or_url(*args, **kwargs): +- return(decode_binary(read_file_or_url(*args, **kwargs).contents)) +- +- + def read_file_or_url(url, timeout=5, retries=10, + headers=None, data=None, sec_between=1, ssl_details=None, + headers_cb=None, exception_cb=None): +@@ -837,10 +833,10 @@ def read_seeded(base="", ext="", timeout + ud_url = "%s%s%s" % (base, "user-data", ext) + md_url = "%s%s%s" % (base, "meta-data", ext) + +- md_resp = load_tfile_or_url(md_url, timeout, retries, file_retries) ++ md_resp = read_file_or_url(md_url, timeout, retries, file_retries) + md = None + if md_resp.ok(): +- md = load_yaml(md_resp.contents, default={}) ++ md = load_yaml(decode_binary(md_resp.contents), default={}) + + ud_resp = read_file_or_url(ud_url, timeout, retries, file_retries) + ud = None +--- a/tests/unittests/test_handler/test_handler_apt_configure.py ++++ b/tests/unittests/test_handler/test_handler_apt_configure.py +@@ -9,6 +9,9 @@ import shutil + import tempfile + import unittest + ++def load_tfile_or_url(*args, **kwargs): ++ return(util.decode_binary(util.read_file_or_url(*args, **kwargs).contents)) ++ + + class TestAptProxyConfig(TestCase): + def setUp(self): +@@ -30,7 +33,7 @@ class TestAptProxyConfig(TestCase): + self.assertTrue(os.path.isfile(self.pfile)) + self.assertFalse(os.path.isfile(self.cfile)) + +- contents = util.load_tfile_or_url(self.pfile) ++ contents = load_tfile_or_url(self.pfile) + self.assertTrue(self._search_apt_config(contents, "http", "myproxy")) + + def test_apt_http_proxy_written(self): +@@ -40,7 +43,7 @@ class TestAptProxyConfig(TestCase): + self.assertTrue(os.path.isfile(self.pfile)) + self.assertFalse(os.path.isfile(self.cfile)) + +- contents = util.load_tfile_or_url(self.pfile) ++ contents = load_tfile_or_url(self.pfile) + self.assertTrue(self._search_apt_config(contents, "http", "myproxy")) + + def test_apt_all_proxy_written(self): +@@ -58,7 +61,7 @@ class TestAptProxyConfig(TestCase): + self.assertTrue(os.path.isfile(self.pfile)) + self.assertFalse(os.path.isfile(self.cfile)) + +- contents = util.load_tfile_or_url(self.pfile) ++ contents = load_tfile_or_url(self.pfile) + + for ptype, pval in values.items(): + self.assertTrue(self._search_apt_config(contents, ptype, pval)) +@@ -74,7 +77,7 @@ class TestAptProxyConfig(TestCase): + cc_apt_configure.apply_apt_config({'apt_proxy': "foo"}, + self.pfile, self.cfile) + self.assertTrue(os.path.isfile(self.pfile)) +- contents = util.load_tfile_or_url(self.pfile) ++ contents = load_tfile_or_url(self.pfile) + self.assertTrue(self._search_apt_config(contents, "http", "foo")) + + def test_config_written(self): +@@ -86,14 +89,14 @@ class TestAptProxyConfig(TestCase): + self.assertTrue(os.path.isfile(self.cfile)) + self.assertFalse(os.path.isfile(self.pfile)) + +- self.assertEqual(util.load_tfile_or_url(self.cfile), payload) ++ self.assertEqual(load_tfile_or_url(self.cfile), payload) + + def test_config_replaced(self): + util.write_file(self.pfile, "content doesnt matter") + cc_apt_configure.apply_apt_config({'apt_config': "foo"}, + self.pfile, self.cfile) + self.assertTrue(os.path.isfile(self.cfile)) +- self.assertEqual(util.load_tfile_or_url(self.cfile), "foo") ++ self.assertEqual(load_tfile_or_url(self.cfile), "foo") + + def test_config_deleted(self): + # if no 'apt_config' is provided, delete any previously written file +--- a/tests/unittests/test_util.py ++++ b/tests/unittests/test_util.py +@@ -459,4 +459,21 @@ class TestMessageFromString(helpers.Test + roundtripped = util.message_from_string(u'\n').as_string() + self.assertNotIn('\x00', roundtripped) + ++ ++class TestReadSeeded(helpers.TestCase): ++ def setUp(self): ++ super(TestReadSeeded, self).setUp() ++ self.tmp = tempfile.mkdtemp() ++ self.addCleanup(shutil.rmtree, self.tmp) ++ ++ def test_unicode_not_messed_up(self): ++ ud = b"userdatablob" ++ helpers.populate_dir( ++ self.tmp, {'meta-data': "key1: val1", 'user-data': ud}) ++ sdir = self.tmp + os.path.sep ++ (found_md, found_ud) = util.read_seeded(sdir) ++ ++ self.assertEqual(found_md, {'key1': 'val1'}) ++ self.assertEqual(found_ud, ud) ++ + # vi: ts=4 expandtab diff -Nru cloud-init-0.7.7~bzr1091/debian/patches/series cloud-init-0.7.7~bzr1091/debian/patches/series --- cloud-init-0.7.7~bzr1091/debian/patches/series 2015-05-25 15:44:30.000000000 +0000 +++ cloud-init-0.7.7~bzr1091/debian/patches/series 2015-06-08 19:38:48.000000000 +0000 @@ -1 +1,2 @@ lp-1375252-1458052-Azure-hostname_password.patch +fix-read-seeded.patch diff -Nru cloud-init-0.7.7~bzr1091/debian/README.source cloud-init-0.7.7~bzr1091/debian/README.source --- cloud-init-0.7.7~bzr1091/debian/README.source 2015-02-26 19:16:35.000000000 +0000 +++ cloud-init-0.7.7~bzr1091/debian/README.source 2015-06-08 19:37:55.000000000 +0000 @@ -34,7 +34,7 @@ You can set 'e' (end) to not go to tip. == Cherry pick single patch == -There is a utility in debian/patches named 'cherry-pick-revno' that will +There is a utility in debian/cherry-pick-rev that will help to cherry pick a single commit from trunk. == New snapshot ==