From 75af4c1acd5e04ee3a20fa1957e89def3840c818 Mon Sep 17 00:00:00 2001 From: Garrett Holmstrom Date: Tue, 27 Jun 2017 15:45:45 -0700 Subject: [PATCH] Fix broken sysconfig file writing on DigitalOcean https://bugzilla.redhat.com/show_bug.cgi?id=1465440 --- cloud-init-0.7.9-nm-resolvconf.patch | 20 ++++++++++++++++++-- cloud-init.spec | 5 ++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/cloud-init-0.7.9-nm-resolvconf.patch b/cloud-init-0.7.9-nm-resolvconf.patch index a4f6cc9..958f352 100644 --- a/cloud-init-0.7.9-nm-resolvconf.patch +++ b/cloud-init-0.7.9-nm-resolvconf.patch @@ -70,10 +70,22 @@ Index: cloud-init-0.7.9/cloudinit/net/sysconfig.py @classmethod def _render_bridge_interfaces(cls, network_state, iface_contents): bridge_filter = renderer.filter_by_type('bridge') -@@ -396,6 +415,12 @@ class Renderer(renderer.Renderer): +@@ -387,18 +406,25 @@ class Renderer(renderer.Renderer): + return contents + + def render_network_state(self, target, network_state): ++ file_mode = 0o644 + base_sysconf_dir = os.path.join(target, self.sysconf_dir) + for path, data in self._render_sysconfig(base_sysconf_dir, + network_state).items(): +- util.write_file(path, data) ++ util.write_file(path, data, file_mode) + if self.dns_path: + dns_path = os.path.join(target, self.dns_path) resolv_content = self._render_dns(network_state, existing_dns_path=dns_path) - util.write_file(dns_path, resolv_content) +- util.write_file(dns_path, resolv_content) ++ util.write_file(dns_path, resolv_content, file_mode) + if self.networkmanager_conf_path: + nm_conf_path = util.target_path(target, + self.networkmanager_conf_path) @@ -83,6 +95,10 @@ Index: cloud-init-0.7.9/cloudinit/net/sysconfig.py if self.netrules_path: netrules_content = self._render_persistent_net(network_state) netrules_path = os.path.join(target, self.netrules_path) +- util.write_file(netrules_path, netrules_content) ++ util.write_file(netrules_path, netrules_content, file_mode) + + # vi: ts=4 expandtab Index: cloud-init-0.7.9/tests/unittests/test_net.py =================================================================== --- cloud-init-0.7.9.orig/tests/unittests/test_net.py diff --git a/cloud-init.spec b/cloud-init.spec index 892991e..27f538c 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,6 +1,6 @@ Name: cloud-init Version: 0.7.9 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Cloud instance init scripts License: GPLv3 URL: http://launchpad.net/cloud-init @@ -242,6 +242,9 @@ nosetests-%{python3_version} tests/unittests/ %changelog +* Tue Jun 27 2017 Garrett Holmstrom - 0.7.9-7 +- Fixed broken sysconfig file writing on DigitalOcean [RH:1465440] + * Wed Jun 21 2017 Garrett Holmstrom - 0.7.9-6 - Fixed NameError in package module [RH:1447708] - Resolved a conflict between cloud-init and NetworkManager writing resolv.conf [RH:1454491 RH:1461959 LP:1693251]