forked from pool/cloud-init
Robert Schweikert
c6ec6841cd
+ fix issue mounting 'ephemeral0' if ephemeral0 was an alias for a partitioned block device with target filesystem on ephemeral0.1. (LP: #1236594) + fix DataSourceAzure incompatibility with 2.6 (LP: #1232175) + fix power_state_change config module so that example works. Improve its documentation and add reference to 'timeout' + support apt-add-archive with 'cloud-archive:' format. (LP: #1244355) + Change SmartOS verb for availability zone (LP: #1249124) + documentation fix for boothooks to use 'cloud-init-per' + fix resizefs module by supporting kernels that do not have /proc/PID/mountinfo. (LP: #1248625) [Tim Daly Jr.] + fix 'make rpm' by removing 0.6.4 entry from ChangeLog (LP: #1241834) + fix omnibus chef installer (LP: #1182265) [Chris Wing] + small fix for OVF datasource for iso transport on non-iso9660 filesystem + determine if upstart version is suitable for 'initctl reload-configuration' (LP: #1124384). If so, then invoke it. supports setting up instance-store disk with partition table and filesystem. + add Azure datasource. + add support for SuSE / SLES [Juerg Haefliger] + add a trailing carriage return to chpasswd input, which reportedly caused a problem on rhel5 if missing. + support individual MIME segments to be gzip compressed (LP: #1203203) + always finalize handlers even if processing failed (LP: #1203368) + support merging into cloud-config via jsonp. (LP: #1200476) + add datasource 'SmartOS' for Joyent Cloud. Adds a dependency on serial. + add 'log_time' helper to util for timing how long things take which also reads from uptime. uptime is useful as clock may change during boot due to ntp. + prefer growpart resizer to 'parted resizepart' (LP: #1212492) OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cloud-init?expand=0&rev=4
91 lines
3.0 KiB
Diff
91 lines
3.0 KiB
Diff
diff -urN cloud-init-0.7.4/cloudinit/distros/opensuse.py cloud-init-0.7.4.os/cloudinit/distros/opensuse.py
|
|
--- cloud-init-0.7.4/cloudinit/distros/opensuse.py 1969-12-31 19:00:00.000000000 -0500
|
|
+++ cloud-init-0.7.4.os/cloudinit/distros/opensuse.py 2013-06-15 06:26:15.312348359 -0400
|
|
@@ -0,0 +1,86 @@
|
|
+# vi: ts=4 expandtab
|
|
+#
|
|
+# Copyright (C) 2013 SUSE LLC
|
|
+#
|
|
+# Author: Robert Schweikert <rjschwei@suse.com>
|
|
+#
|
|
+# Leaning very heavily on the RHEL implementation
|
|
+#
|
|
+# This program is free software: you can redistribute it and/or modify
|
|
+# it under the terms of the GNU General Public License version 3, as
|
|
+# published by the Free Software Foundation.
|
|
+#
|
|
+# This program is distributed in the hope that it will be useful,
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
+# GNU General Public License for more details.
|
|
+#
|
|
+# You should have received a copy of the GNU General Public License
|
|
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
+
|
|
+import os
|
|
+
|
|
+from cloudinit.distros import sles
|
|
+
|
|
+from cloudinit.distros.parsers.resolv_conf import ResolvConf
|
|
+from cloudinit.distros.parsers.sys_conf import SysConf
|
|
+
|
|
+from cloudinit import helpers
|
|
+from cloudinit import log as logging
|
|
+from cloudinit import util
|
|
+
|
|
+from cloudinit.settings import PER_INSTANCE
|
|
+
|
|
+LOG = logging.getLogger(__name__)
|
|
+
|
|
+class Distro(sles.Distro):
|
|
+ systemd_locale_conf_fn = '/etc/locale.conf'
|
|
+
|
|
+ def __init__(self, name, cfg, paths):
|
|
+ sles.Distro.__init__(self, name, cfg, paths)
|
|
+
|
|
+ def apply_locale(self, locale, out_fn=None):
|
|
+ if os.path.exists('/usr/bin/localectl'):
|
|
+ if not out_fn:
|
|
+ out_fn = systemd_locale_conf_fn
|
|
+ locale_cfg = {
|
|
+ 'LANG': locale,
|
|
+ }
|
|
+ else:
|
|
+ if not out_fn:
|
|
+ out_fn = self.locale_conf_fn
|
|
+ locale_cfg = {
|
|
+ 'RC_LANG': locale,
|
|
+ }
|
|
+ util.update_sysconfig_file(out_fn, locale_cfg)
|
|
+
|
|
+ def _write_hostname(self, hostname, out_fn):
|
|
+ if os.path.exists('/usr/bin/hostnamectl'):
|
|
+ util.subp(['hostnamectl', 'set-hostname', str(hostname)])
|
|
+ else:
|
|
+ host_cfg = {
|
|
+ 'HOSTNAME': hostname,
|
|
+ }
|
|
+ util.update_sysconfig_file(out_fn, host_cfg)
|
|
+
|
|
+ def _select_hostname(self, hostname, fqdn):
|
|
+ if fqdn:
|
|
+ return fqdn
|
|
+ return hostname
|
|
+
|
|
+ def _read_system_hostname(self):
|
|
+ host_fn = self.hostname_conf_fn
|
|
+ return (host_fn, self._read_hostname(host_fn))
|
|
+
|
|
+ def _read_hostname(self, filename, default=None):
|
|
+ (out, _err) = util.subp(['hostname'])
|
|
+ if len(out):
|
|
+ return out
|
|
+ else:
|
|
+ (_exists, contents) = self._read_conf(filename)
|
|
+ if 'HOSTNAME' in contents:
|
|
+ return contents['HOSTNAME']
|
|
+ else:
|
|
+ return default
|
|
+
|
|
+
|