From 45ef3b0bcca98d090c18366ff1252164274d855a Mon Sep 17 00:00:00 2001 From: Garrett Holmstrom Date: Wed, 6 Jul 2016 18:38:38 -0700 Subject: [PATCH] Update to bzr snapshot 1245 --- cloud-init-0.7.6-bzr1060-groupadd-list.patch | 31 ---------- ...ch => cloud-init-0.7.6-bzr1245-ecdsa.patch | 12 ++-- cloud-init-0.7.6-bzr1245-fedora.patch | 12 ++++ cloud-init-0.7.6-bzr1245-groupadd-list.patch | 38 ++++++++++++ cloud-init-README.fedora | 11 +++- cloud-init-fedora.cfg | 6 +- cloud-init.spec | 62 +++++++++---------- sources | 2 +- 8 files changed, 101 insertions(+), 73 deletions(-) delete mode 100644 cloud-init-0.7.6-bzr1060-groupadd-list.patch rename cloud-init-0.7.6-ecdsa.patch => cloud-init-0.7.6-bzr1245-ecdsa.patch (58%) create mode 100644 cloud-init-0.7.6-bzr1245-fedora.patch create mode 100644 cloud-init-0.7.6-bzr1245-groupadd-list.patch diff --git a/cloud-init-0.7.6-bzr1060-groupadd-list.patch b/cloud-init-0.7.6-bzr1060-groupadd-list.patch deleted file mode 100644 index 7f38924..0000000 --- a/cloud-init-0.7.6-bzr1060-groupadd-list.patch +++ /dev/null @@ -1,31 +0,0 @@ -Index: cloud-init-0.7.6-bzr1060/cloudinit/distros/__init__.py -=================================================================== ---- cloud-init-0.7.6-bzr1060.orig/cloudinit/distros/__init__.py -+++ cloud-init-0.7.6-bzr1060/cloudinit/distros/__init__.py -@@ -333,11 +333,16 @@ class Distro(object): - } - - redact_opts = ['passwd'] -+ # Options that are comma separated lists which we need to parse -+ list_stripped_opts = ['groups'] - - # Check the values and create the command - for key, val in kwargs.items(): - - if key in adduser_opts and val and isinstance(val, str): -+ if key in list_stripped_opts: -+ values = [x.strip() for x in val.split(',')] -+ val = ','.join(values) - adduser_cmd.extend([adduser_opts[key], val]) - - # Redact certain fields from the logs -@@ -629,6 +634,9 @@ def _normalize_groups(grp_cfg): - raise TypeError("Bad group member type %s" % - type_utils.obj_name(v)) - elif isinstance(i, six.string_types): -+ # Common to have leading whitespace in string lists, -+ # but not all useradd tools will support it.- -+ i = i.strip() - if i not in c_grp_cfg: - c_grp_cfg[i] = [] - else: diff --git a/cloud-init-0.7.6-ecdsa.patch b/cloud-init-0.7.6-bzr1245-ecdsa.patch similarity index 58% rename from cloud-init-0.7.6-ecdsa.patch rename to cloud-init-0.7.6-bzr1245-ecdsa.patch index cc2e2c7..fe6b54f 100644 --- a/cloud-init-0.7.6-ecdsa.patch +++ b/cloud-init-0.7.6-bzr1245-ecdsa.patch @@ -1,11 +1,11 @@ -Index: cloud-init-0.7.6/cloudinit/ssh_util.py +Index: cloud-init-0.7.6-bzr1245/cloudinit/ssh_util.py =================================================================== ---- cloud-init-0.7.6.orig/cloudinit/ssh_util.py -+++ cloud-init-0.7.6/cloudinit/ssh_util.py -@@ -32,6 +32,7 @@ DEF_SSHD_CFG = "/etc/ssh/sshd_config" - +--- cloud-init-0.7.6-bzr1245.orig/cloudinit/ssh_util.py ++++ cloud-init-0.7.6-bzr1245/cloudinit/ssh_util.py +@@ -33,6 +33,7 @@ DEF_SSHD_CFG = "/etc/ssh/sshd_config" # taken from openssh source key.c/key_type_from_name - VALID_KEY_TYPES = ("rsa", "dsa", "ssh-rsa", "ssh-dss", "ecdsa", + VALID_KEY_TYPES = ( + "rsa", "dsa", "ssh-rsa", "ssh-dss", "ecdsa", + "ecdsa-sha2-nistp256", "ecdsa-sha2-nistp384", "ecdsa-sha2-nistp521", "ssh-rsa-cert-v00@openssh.com", "ssh-dss-cert-v00@openssh.com", "ssh-rsa-cert-v00@openssh.com", "ssh-dss-cert-v00@openssh.com", diff --git a/cloud-init-0.7.6-bzr1245-fedora.patch b/cloud-init-0.7.6-bzr1245-fedora.patch new file mode 100644 index 0000000..528e126 --- /dev/null +++ b/cloud-init-0.7.6-bzr1245-fedora.patch @@ -0,0 +1,12 @@ +Index: cloud-init-0.7.6-bzr1245/setup.py +=================================================================== +--- cloud-init-0.7.6-bzr1245.orig/setup.py ++++ cloud-init-0.7.6-bzr1245/setup.py +@@ -207,7 +207,6 @@ setuptools.setup( + scripts=['tools/cloud-init-per'], + license='GPLv3', + data_files=data_files, +- install_requires=requirements, + cmdclass=cmdclass, + entry_points={ + 'console_scripts': [ diff --git a/cloud-init-0.7.6-bzr1245-groupadd-list.patch b/cloud-init-0.7.6-bzr1245-groupadd-list.patch new file mode 100644 index 0000000..e05fdd4 --- /dev/null +++ b/cloud-init-0.7.6-bzr1245-groupadd-list.patch @@ -0,0 +1,38 @@ +Index: cloud-init-0.7.6-bzr1245/cloudinit/distros/__init__.py +=================================================================== +--- cloud-init-0.7.6-bzr1245.orig/cloudinit/distros/__init__.py ++++ cloud-init-0.7.6-bzr1245/cloudinit/distros/__init__.py +@@ -376,7 +376,7 @@ class Distro(object): + # that can go right through to the command. + kwargs['groups'] = ",".join(groups) + else: +- groups = groups.split(",") ++ groups = [group.strip() for group in groups.split(",")] + + primary_group = kwargs.get('primary_group') + if primary_group: +@@ -673,7 +673,7 @@ def _get_arch_package_mirror_info(packag + # of cloud-init + def _normalize_groups(grp_cfg): + if isinstance(grp_cfg, six.string_types): +- grp_cfg = grp_cfg.strip().split(",") ++ grp_cfg = [grp.strip() for grp in grp_cfg.strip().split(",")] + if isinstance(grp_cfg, list): + c_grp_cfg = {} + for i in grp_cfg: +@@ -691,11 +691,14 @@ def _normalize_groups(grp_cfg): + if isinstance(v, list): + c_grp_cfg[k].extend(v) + elif isinstance(v, six.string_types): +- c_grp_cfg[k].append(v) ++ c_grp_cfg[k].append(v.strip()) + else: + raise TypeError("Bad group member type %s" % + type_utils.obj_name(v)) + elif isinstance(i, six.string_types): ++ # Common to have leading whitespace in string lists, ++ # but not all useradd tools will support it. ++ i = i.strip() + if i not in c_grp_cfg: + c_grp_cfg[i] = [] + else: diff --git a/cloud-init-README.fedora b/cloud-init-README.fedora index aa29630..2ca21e7 100644 --- a/cloud-init-README.fedora +++ b/cloud-init-README.fedora @@ -1,5 +1,12 @@ The following cloud-init modules are currently unsupported on this OS: - - apt_update_upgrade ('apt_update', 'apt_upgrade', 'apt_mirror', 'apt_preserve_sources_list', 'apt_old_mirror', 'apt_sources', 'debconf_selections', 'packages' options) - - byobu ('byobu_by_default' option) + - apt-configure + - apt-pipelining + - apt_update_upgrade + - byobu - chef + - emit_upstart + - fan - grub_dpkg + - landscape + - lxd + - snappy diff --git a/cloud-init-fedora.cfg b/cloud-init-fedora.cfg index 0dff3fe..92297a8 100644 --- a/cloud-init-fedora.cfg +++ b/cloud-init-fedora.cfg @@ -12,8 +12,9 @@ syslog_fix_perms: ~ cloud_init_modules: - migrator + - seed_random - bootcmd - - write-files + - write_files - growpart - resizefs - set_hostname @@ -24,6 +25,7 @@ cloud_init_modules: - ssh cloud_config_modules: + - disk_setup - mounts - locale - set-passwords @@ -39,6 +41,7 @@ cloud_config_modules: cloud_final_modules: - rightscale_userdata + - scripts-vendor - scripts-per-once - scripts-per-boot - scripts-per-instance @@ -47,6 +50,7 @@ cloud_final_modules: - keys-to-console - phone-home - final-message + - power-state-change system_info: default_user: diff --git a/cloud-init.spec b/cloud-init.spec index 143f351..f9906d7 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,52 +1,45 @@ -%{!?license: %global license %%doc} - Name: cloud-init Version: 0.7.6 -Release: 8.20150813bzr1137%{?dist} +Release: 9.20160622bzr1245%{?dist} Summary: Cloud instance init scripts Group: System Environment/Base License: GPLv3 URL: http://launchpad.net/cloud-init #Source0: https://launchpad.net/cloud-init/trunk/%{version}/+download/%{name}-%{version}.tar.gz -# bzr export -r 1137 cloud-init-0.7.6-bzr1137.tar.gz lp:cloud-init -Source0: cloud-init-0.7.6-bzr1137.tar.gz +# bzr export -r 1245 cloud-init-0.7.6-bzr1245.tar.gz lp:cloud-init +Source0: cloud-init-0.7.6-bzr1245.tar.gz Source1: cloud-init-fedora.cfg Source2: cloud-init-README.fedora Source3: cloud-init-tmpfiles.conf +Patch0: cloud-init-0.7.6-bzr1245-fedora.patch + # Fix rsyslog log filtering # https://code.launchpad.net/~gholms/cloud-init/rsyslog-programname/+merge/186906 Patch1: cloud-init-0.7.5-rsyslog-programname.patch -# Systemd 213 removed the --quiet option from ``udevadm settle'' -Patch2: cloud-init-0.7.5-udevadm-quiet.patch - # Add 3 ecdsa-sha2-nistp* ssh key types now that they are standardized # https://bugzilla.redhat.com/show_bug.cgi?id=1151824 -Patch3: cloud-init-0.7.6-ecdsa.patch +Patch3: cloud-init-0.7.6-bzr1245-ecdsa.patch # Handle whitespace in lists of groups to add new users to # https://bugs.launchpad.net/cloud-init/+bug/1354694 # https://bugzilla.redhat.com/show_bug.cgi?id=1126365 -Patch4: cloud-init-0.7.6-bzr1060-groupadd-list.patch +Patch4: cloud-init-0.7.6-bzr1245-groupadd-list.patch # Use dnf instead of yum when available # https://bugzilla.redhat.com/show_bug.cgi?id=1194451 Patch7: cloud-init-0.7.6-dnf.patch -# Deal with noarch -> arch -# https://bugzilla.redhat.com/show_bug.cgi?id=1067089 -# -# In cloud-init-0.7.6-4 we switched back to noarch now that it uses -# sysfs for DMI data on linux. -Obsoletes: cloud-init < 0.7.6-4 - BuildArch: noarch +BuildRequires: pkgconfig BuildRequires: python3-devel BuildRequires: python3-setuptools -BuildRequires: systemd-units +BuildRequires: systemd +# For pkgconfig +BuildRequires: systemd-devel # For tests BuildRequires: iproute @@ -62,6 +55,7 @@ BuildRequires: python3-pyserial BuildRequires: python3-PyYAML BuildRequires: python3-requests BuildRequires: python3-six +BuildRequires: python3-unittest2 Requires: e2fsprogs Requires: iproute @@ -79,10 +73,10 @@ Requires: python3-PyYAML Requires: python3-requests Requires: python3-six Requires: shadow-utils +Requires: util-linux Requires: /usr/bin/run-parts -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units +%{?systemd_requires} + %description Cloud-init is a set of init scripts for cloud instances. Cloud instances @@ -91,7 +85,7 @@ ssh keys and to let the user run various scripts. %prep -%autosetup -p1 -n %{name}-%{version}-bzr1137 +%autosetup -p1 -n %{name}-%{version}-bzr1245 # Change shebangs sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/env python3|' \ @@ -106,7 +100,7 @@ cp -p %{SOURCE2} README.fedora %install rm -rf $RPM_BUILD_ROOT -%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT --init-system=systemd +%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT --init-system=systemd # Don't ship the tests rm -r $RPM_BUILD_ROOT%{python3_sitelib}/tests @@ -115,7 +109,7 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/cloud # /run/cloud-init needs a tmpfiles.d entry mkdir -p $RPM_BUILD_ROOT/run/cloud-init -mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir} +mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir} cp -p %{SOURCE3} $RPM_BUILD_ROOT/%{_tmpfilesdir}/%{name}.conf # We supply our own config file since our software differs from Ubuntu's. @@ -124,13 +118,11 @@ cp -p %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/cloud/cloud.cfg mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d cp -p tools/21-cloudinit.conf $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf -# Install the systemd bits -mkdir -p $RPM_BUILD_ROOT/%{_unitdir} -cp -p systemd/* $RPM_BUILD_ROOT/%{_unitdir} %check nosetests-%{python3_version} + %clean rm -rf $RPM_BUILD_ROOT @@ -138,10 +130,12 @@ rm -rf $RPM_BUILD_ROOT %post # These services are now enabled by the cloud image's kickstart. # They should probably be done with a preset instead. -%systemd_post cloud-config.service cloud-final.service cloud-init.service cloud-init-local.service +%systemd_post cloud-config.service cloud-config.target cloud-final.service cloud-init.service cloud-init.target cloud-init-local.service + %preun -%systemd_preun cloud-config.service cloud-final.service cloud-init.service cloud-init-local.service +%systemd_preun cloud-config.service cloud-config.target cloud-final.service cloud-init.service cloud-init.target cloud-init-local.service + %postun %systemd_postun @@ -159,22 +153,26 @@ rm -rf $RPM_BUILD_ROOT %config(noreplace) %{_sysconfdir}/cloud/templates/* /lib/udev/rules.d/66-azure-ephemeral.rules %{_unitdir}/cloud-config.service -%{_unitdir}/cloud-config.target %{_unitdir}/cloud-final.service -%{_unitdir}/cloud-init-local.service %{_unitdir}/cloud-init.service +%{_unitdir}/cloud-init-local.service +%{_unitdir}/cloud-config.target +%{_unitdir}/cloud-init.target +/usr/lib/systemd/system-generators/cloud-init-generator %{_tmpfilesdir}/%{name}.conf %{python3_sitelib}/* %{_libexecdir}/%{name} %{_bindir}/cloud-init* %dir /run/cloud-init %dir /var/lib/cloud - %dir %{_sysconfdir}/rsyslog.d %config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf %changelog +* Wed Jul 6 2016 Garrett Holmstrom - 0.7.6-20160622bzr1245 +- Updated to bzr snapshot 1245 + * Wed Feb 03 2016 Fedora Release Engineering - 0.7.6-8.20150813bzr1137 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index 968d357..6567d5a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b8537b7002f2904e0c1cf247b16a998f cloud-init-0.7.6-bzr1137.tar.gz +c7c12536f909c472d259d5039450c5b7 cloud-init-0.7.6-bzr1245.tar.gz