- add patch azure_1269626.diff, fix for upstream bug 1269626 + Azure instance do not boot properly after a capture operation OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=7
This commit is contained in:
parent
2f5d8a6a77
commit
b363ee2095
87
azure_1269626.diff
Normal file
87
azure_1269626.diff
Normal file
@ -0,0 +1,87 @@
|
||||
=== modified file 'cloudinit/sources/DataSourceAzure.py'
|
||||
--- cloudinit/sources/DataSourceAzure.py 2014-01-09 18:12:40 +0000
|
||||
+++ cloudinit/sources/DataSourceAzure.py 2014-02-07 11:51:56 +0000
|
||||
@@ -84,9 +84,14 @@
|
||||
|
||||
candidates = [self.seed_dir]
|
||||
candidates.extend(list_possible_azure_ds_devs())
|
||||
+ previous_ovf_cfg = None
|
||||
if ddir:
|
||||
candidates.append(ddir)
|
||||
|
||||
+ previous_ovf_cfg = None
|
||||
+ if os.path.exists("%s/ovf-env.xml" % ddir):
|
||||
+ previous_ovf_cfg = load_azure_ds_dir(ddir)
|
||||
+
|
||||
found = None
|
||||
|
||||
for cdev in candidates:
|
||||
@@ -104,6 +109,11 @@
|
||||
LOG.warn("%s was not mountable" % cdev)
|
||||
continue
|
||||
|
||||
+ if ret != previous_ovf_cfg:
|
||||
+ LOG.info(("instance configuration has changed, "
|
||||
+ "removing old agent directory"))
|
||||
+ util.del_dir(ddir)
|
||||
+
|
||||
(md, self.userdata_raw, cfg, files) = ret
|
||||
self.seed = cdev
|
||||
self.metadata = util.mergemanydict([md, DEFAULT_METADATA])
|
||||
|
||||
=== modified file 'tests/unittests/test_datasource/test_azure.py'
|
||||
--- tests/unittests/test_datasource/test_azure.py 2013-10-02 21:05:15 +0000
|
||||
+++ tests/unittests/test_datasource/test_azure.py 2014-02-07 11:51:56 +0000
|
||||
@@ -119,6 +119,10 @@
|
||||
{'ovf-env.xml': data['ovfcontent']})
|
||||
|
||||
mod = DataSourceAzure
|
||||
+ ddir = "%s/var/lib/waagent" % self.tmp
|
||||
+ mod.BUILTIN_DS_CONFIG['data_dir'] = ddir
|
||||
+ if not os.path.isdir(ddir):
|
||||
+ os.makedirs(ddir)
|
||||
|
||||
self.apply_patches([(mod, 'list_possible_azure_ds_devs', dsdevs)])
|
||||
|
||||
@@ -338,6 +342,40 @@
|
||||
|
||||
self.assertEqual(userdata, dsrc.userdata_raw)
|
||||
|
||||
+ def test_existing_ovf_same(self):
|
||||
+ mydata = "FOOBAR"
|
||||
+ odata = {'UserData': base64.b64encode(mydata)}
|
||||
+ data = {'ovfcontent': construct_valid_ovf_env(data=odata)}
|
||||
+
|
||||
+ with open("%s/ovf-env.xml" % self.tmp, 'w') as fp:
|
||||
+ fp.write(construct_valid_ovf_env(data=odata))
|
||||
+ with open("%s/sem" % self.tmp, 'w') as fp:
|
||||
+ fp.write("test")
|
||||
+
|
||||
+ dsrc = self._get_ds(data)
|
||||
+ ret = dsrc.get_data()
|
||||
+ self.assertTrue(ret)
|
||||
+ self.assertEqual(dsrc.userdata_raw, mydata)
|
||||
+ self.assertTrue(os.path.exists("%s/sem" % self.tmp))
|
||||
+
|
||||
+ def test_existing_ovf_diff(self):
|
||||
+ mydata = "FOOBAR"
|
||||
+ odata = {'UserData': base64.b64encode(mydata)}
|
||||
+ data = {'ovfcontent': construct_valid_ovf_env(data=odata)}
|
||||
+
|
||||
+ data_dir = "%s/var/lib/waagent" % self.tmp
|
||||
+ os.makedirs(data_dir)
|
||||
+ with open("%s/ovf-env.xml" % data_dir, 'w') as fp:
|
||||
+ fp.write(construct_valid_ovf_env())
|
||||
+ with open("%s/sem" % data_dir, 'w') as fp:
|
||||
+ fp.write("test")
|
||||
+
|
||||
+ dsrc = self._get_ds(data)
|
||||
+ ret = dsrc.get_data()
|
||||
+ self.assertTrue(ret)
|
||||
+ self.assertEqual(dsrc.userdata_raw, mydata)
|
||||
+ self.assertFalse(os.path.exists("%s/sem" % data_dir))
|
||||
+
|
||||
|
||||
class TestReadAzureOvf(MockerTestCase):
|
||||
def test_invalid_xml_raises_non_azure_ds(self):
|
||||
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 17 18:37:58 UTC 2014 - rschweikert@suse.com
|
||||
|
||||
- include in SLE 12 (FATE #315990, #315991, and 316167)
|
||||
- add patch azure_1269626.diff, fix for upstream bug 1269626
|
||||
+ Azure instance do not boot properly after a capture operation
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 17 17:58:23 UTC 2014 - rschweikert@suse.com
|
||||
|
||||
|
@ -28,6 +28,7 @@ Patch0: suseSysVInit.diff
|
||||
Patch1: addopenSUSEBase.diff
|
||||
Patch2: openSUSEHandler.diff
|
||||
Patch3: setupSUSEsysVInit.diff
|
||||
Patch4: azure_1269626.diff
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: filesystem
|
||||
BuildRequires: python-devel
|
||||
@ -96,6 +97,7 @@ Unit tests for the cloud-init tools
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4
|
||||
%if 0%{?suse_version} <= 1130
|
||||
# disable ecdsa for SLE 11 (not available)
|
||||
echo "ssh_genkeytypes: ['rsa', 'dsa']" >> %{SOURCE1}
|
||||
|
Loading…
Reference in New Issue
Block a user