From 41dea386e6379b5394c6eaf45998d36387351575ec6a578a52ee6f099090da7f Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Wed, 20 May 2015 21:54:02 +0000 Subject: [PATCH] - Properly write the routes file for static networks (bnc#920190) + modify suseIntegratedHandler.patch - Remove suseSetInitCmd.patch + is now integrated with suseIntegratedHandler.patch OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=35 --- cloud-init.changes | 8 ++++++++ cloud-init.spec | 3 --- suseIntegratedHandler.patch | 20 ++++++++++++++++---- suseSetInitCmd.patch | 25 ------------------------- 4 files changed, 24 insertions(+), 32 deletions(-) delete mode 100644 suseSetInitCmd.patch diff --git a/cloud-init.changes b/cloud-init.changes index 2030fe9..daec6f4 100644 --- a/cloud-init.changes +++ b/cloud-init.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed May 20 18:27:02 UTC 2015 - rjschwei@suse.com + +- Properly write the routes file for static networks (bnc#920190) + + modify suseIntegratedHandler.patch +- Remove suseSetInitCmd.patch + + is now integrated with suseIntegratedHandler.patch + ------------------------------------------------------------------- Mon Apr 27 12:26:32 UTC 2015 - rjschwei@suse.com diff --git a/cloud-init.spec b/cloud-init.spec index d9ba16a..832ecf8 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -35,8 +35,6 @@ Patch3: setupSUSEsysVInit.diff Patch5: openSUSEhostsTemplate.diff # FIXME dynamicInitCmd.patch proposed for upstream merge Patch6: dynamicInitCmd.diff -# FIXME suseSetInitCmd.patch send upstream once the SUSE handlers are accepted -Patch7: suseSetInitCmd.patch Patch9: cloud-init-no-dmidecode-on-ppc64.patch Patch10: cloud-init-no-user-lock-if-already-locked.patch Patch11: dataSourceOpenNebula.patch @@ -134,7 +132,6 @@ Unit tests for the cloud-init tools %patch3 -p1 %patch5 %patch6 -%patch7 %patch9 -p1 %patch10 -p1 %patch11 -p2 diff --git a/suseIntegratedHandler.patch b/suseIntegratedHandler.patch index 2b2676c..e56beb2 100644 --- a/suseIntegratedHandler.patch +++ b/suseIntegratedHandler.patch @@ -1,6 +1,6 @@ --- /dev/null +++ cloudinit/distros/opensuse.py -@@ -0,0 +1,209 @@ +@@ -0,0 +1,221 @@ +# vi: ts=4 expandtab +# +# Copyright (C) 2014 SUSE LLC @@ -42,8 +42,10 @@ + locale_conf_fn = '/etc/sysconfig/language' + network_conf_fn = '/etc/sysconfig/network' + hostname_conf_fn = '/etc/HOSTNAME' ++ init_cmd = ['service'] + network_script_tpl = '/etc/sysconfig/network/ifcfg-%s' + resolve_conf_fn = '/etc/resolv.conf' ++ route_conf_tpl = '/etc/sysconfig/network/ifroute-%s' + tz_local_fn = '/etc/localtime' + systemd_locale_conf_fn = '/etc/locale.conf' + @@ -53,9 +55,13 @@ + # calls from repeatly happening (when they + # should only happen say once per instance...) + self._runner = helpers.Runners(paths) ++ cfg['ssh_svcname'] = 'sshd' + self.osfamily = 'suse' + self.systemdDist = util.which('systemctl') -+ ++ if self.systemdDist: ++ self.init_cmd = ['systemctl'] ++ cfg['ssh_svcname'] = 'sshd.service' ++ + def apply_locale(self, locale, out_fn=None): + if self.systemdDist: + if not out_fn: @@ -176,15 +182,18 @@ + dev_names = entries.keys() + for (dev, info) in entries.iteritems(): + net_fn = self.network_script_tpl % (dev) ++ route_fn = self.route_conf_tpl % (dev) + mode = None + if info.get('auto', None): + mode = 'auto' + else: + mode = 'manual' ++ bootproto = info.get('bootproto', None) ++ gateway = info.get('gateway', None) + net_cfg = { -+ 'BOOTPROTO': info.get('bootproto'), ++ 'BOOTPROTO': bootproto, + 'BROADCAST': info.get('broadcast'), -+ 'GATEWAY': info.get('gateway'), ++ 'GATEWAY': gateway, + 'IPADDR': info.get('address'), + 'LLADDR': info.get('hwaddress'), + 'NETMASK': info.get('netmask'), @@ -196,6 +205,9 @@ + else: + net_cfg['FIREWALL'] = 'no' + rhutil.update_sysconfig_file(net_fn, net_cfg, True) ++ if gateway and bootproto == 'static': ++ default_route = 'default %s' %gateway ++ util.write_file(route_fn, default_route, 0644) + if 'dns-nameservers' in info: + nameservers.extend(info['dns-nameservers']) + if 'dns-search' in info: diff --git a/suseSetInitCmd.patch b/suseSetInitCmd.patch deleted file mode 100644 index a7f5a1d..0000000 --- a/suseSetInitCmd.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- cloudinit/distros/opensuse.py.orig -+++ cloudinit/distros/opensuse.py -@@ -43,6 +43,7 @@ class Distro(distros.Distro): - resolve_conf_fn = '/etc/resolv.conf' - tz_local_fn = '/etc/localtime' - systemd_locale_conf_fn = '/etc/locale.conf' -+ init_cmd = ['service'] - - def __init__(self, name, cfg, paths): - distros.Distro.__init__(self, name, cfg, paths) -@@ -50,9 +51,13 @@ class Distro(distros.Distro): - # calls from repeatly happening (when they - # should only happen say once per instance...) - self._runner = helpers.Runners(paths) -+ cfg['ssh_svcname'] = 'sshd' - self.osfamily = 'suse' - self.systemdDist = util.which('systemctl') -- -+ if self.systemdDist: -+ self.init_cmd = ['systemctl'] -+ cfg['ssh_svcname'] = 'sshd.service' -+ - def apply_locale(self, locale, out_fn=None): - if self.systemdDist: - if not out_fn: