diff --git a/bugfix-cloud-init-add-euleros-os.patch b/bugfix-cloud-init-add-openEuler-os.patch similarity index 85% rename from bugfix-cloud-init-add-euleros-os.patch rename to bugfix-cloud-init-add-openEuler-os.patch index 96e345a..17811a6 100644 --- a/bugfix-cloud-init-add-euleros-os.patch +++ b/bugfix-cloud-init-add-openEuler-os.patch @@ -1,9 +1,9 @@ From 098429a75ea00df1d8a5670e45df6babfc37f327 Mon Sep 17 00:00:00 2001 From: chengquan Date: Thu, 8 Aug 2019 16:11:58 +0800 -Subject: [PATCH] cloud-init: cloud-init add euleros os +Subject: [PATCH] cloud-init: cloud-init add openEuler os -reason: add euleros into distros +reason: add openEuler into distros Signed-off-by: chengquan --- @@ -14,7 +14,7 @@ Signed-off-by: chengquan cloud-init-17.1/cloudinit/config/cc_spacewalk.py | 2 +- .../cloudinit/config/cc_yum_add_repo.py | 2 +- cloud-init-17.1/cloudinit/distros/__init__.py | 2 +- - cloud-init-17.1/cloudinit/distros/euleros.py | 12 ++++ + cloud-init-17.1/cloudinit/distros/openEuler.py | 12 ++++ cloud-init-17.1/cloudinit/util.py | 2 +- cloud-init-17.1/config/cloud.cfg.tmpl | 8 +-- cloud-init-17.1/systemd/cloud-init.service.tmpl | 2 +- @@ -22,7 +22,7 @@ Signed-off-by: chengquan .../unittests/test_handler/test_handler_ntp.py | 2 +- cloud-init-17.1/tools/render-cloudcfg | 2 +- 14 files changed, 95 insertions(+), 15 deletions(-) - create mode 100644 cloud-init-17.1/cloudinit/distros/euleros.py + create mode 100644 cloud-init-17.1/cloudinit/distros/openEuler.py diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py index d43d060..4f14c10 100644 @@ -33,35 +33,35 @@ index d43d060..4f14c10 100644 TIMESYNCD_CONF = '/etc/systemd/timesyncd.conf.d/cloud-init.conf' NR_POOL_SERVERS = 4 -distros = ['centos', 'debian', 'fedora', 'opensuse', 'ubuntu'] -+distros = ['centos', 'debian', 'fedora', 'opensuse', 'ubuntu', 'euleros'] - - ++distros = ['centos', 'debian', 'fedora', 'opensuse', 'ubuntu', 'openEuler'] + + # The schema definition for each cloud-config module is a strict contract for diff --git a/cloudinit/config/cc_resolv_conf.py b/cloudinit/config/cc_resolv_conf.py index 9812562..973fe2e 100644 --- a/cloudinit/config/cc_resolv_conf.py +++ b/cloudinit/config/cc_resolv_conf.py @@ -55,7 +55,7 @@ LOG = logging.getLogger(__name__) - + frequency = PER_INSTANCE - + -distros = ['fedora', 'opensuse', 'rhel', 'sles'] -+distros = ['fedora', 'opensuse', 'rhel', 'sles', 'euleros'] - - ++distros = ['fedora', 'opensuse', 'rhel', 'sles', 'openEuler'] + + def generate_resolv_conf(template_fn, params, target_fname="/etc/resolv.conf"): diff --git a/cloudinit/config/cc_rh_subscription.py b/cloudinit/config/cc_rh_subscription.py index 7f36cf8..23f3a5a 100644 --- a/cloudinit/config/cc_rh_subscription.py +++ b/cloudinit/config/cc_rh_subscription.py @@ -40,7 +40,7 @@ Subscription`` example config. - + from cloudinit import util - + -distros = ['fedora', 'rhel'] -+distros = ['fedora', 'rhel', 'euleros'] - - ++distros = ['fedora', 'rhel', 'openEuler'] + + def handle(name, cfg, _cloud, log, _args): diff --git a/cloudinit/config/cc_spacewalk.py b/cloudinit/config/cc_spacewalk.py index 1020e94..63e9d3b 100644 @@ -69,36 +69,36 @@ index 1020e94..63e9d3b 100644 +++ b/cloudinit/config/cc_spacewalk.py @@ -30,7 +30,7 @@ For more information about spacewalk see: https://fedorahosted.org/spacewalk/ from cloudinit import util - - + + -distros = ['redhat', 'fedora'] -+distros = ['redhat', 'fedora', 'euleros'] ++distros = ['redhat', 'fedora', 'openEuler'] required_packages = ['rhn-setup'] def_ca_cert_path = "/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT" - + diff --git a/cloudinit/config/cc_yum_add_repo.py b/cloudinit/config/cc_yum_add_repo.py index 6a42f49..9b2d1bd 100644 --- a/cloudinit/config/cc_yum_add_repo.py +++ b/cloudinit/config/cc_yum_add_repo.py @@ -40,7 +40,7 @@ import six - + from cloudinit import util - + -distros = ['fedora', 'rhel'] -+distros = ['fedora', 'rhel', 'euleros'] - - ++distros = ['fedora', 'rhel', 'openEuler'] + + def _canonicalize_id(repo_id): diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py index d5becd1..f6eb899 100755 --- a/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py @@ -36,7 +36,7 @@ ALL_DISTROS = 'all' - + OSFAMILIES = { 'debian': ['debian', 'ubuntu'], - 'redhat': ['centos', 'fedora', 'rhel'], -+ 'redhat': ['centos', 'fedora', 'rhel', 'euleros'], ++ 'redhat': ['centos', 'fedora', 'rhel', 'openEuler'], 'gentoo': ['gentoo'], 'freebsd': ['freebsd'], 'suse': ['opensuse', 'sles'], @@ -111,7 +111,7 @@ index e1290aa..d85daf0 100644 if system == "linux": linux_dist = info['dist'][0].lower() - if linux_dist in ('centos', 'fedora', 'debian'): -+ if linux_dist in ('centos', 'fedora', 'debian', 'euleros'): ++ if linux_dist in ('centos', 'fedora', 'debian', 'openEuler'): var = linux_dist elif linux_dist in ('ubuntu', 'linuxmint', 'mint'): var = 'ubuntu' @@ -122,9 +122,9 @@ index 50e3bd8..e3816f2 100644 @@ -19,7 +19,7 @@ disable_root: false disable_root: true {% endif %} - + -{% if variant in ["centos", "fedora", "rhel"] %} -+{% if variant in ["centos", "fedora", "rhel", "euleros"] %} ++{% if variant in ["centos", "fedora", "rhel", "openEuler"] %} mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2'] resize_rootfs_tmp: /dev ssh_deletekeys: 0 @@ -133,7 +133,7 @@ index 50e3bd8..e3816f2 100644 - locale - set-passwords -{% if variant in ["rhel", "fedora"] %} -+{% if variant in ["rhel", "fedora", "euleros"] %} ++{% if variant in ["rhel", "fedora", "openEuler"] %} - spacewalk - yum-add-repo {% endif %} @@ -142,7 +142,7 @@ index 50e3bd8..e3816f2 100644 system_info: # This will affect which distro class gets used -{% if variant in ["centos", "debian", "fedora", "rhel", "suse", "ubuntu", "freebsd"] %} -+{% if variant in ["centos", "debian", "fedora", "rhel", "suse", "ubuntu", "freebsd", "euleros"] %} ++{% if variant in ["centos", "debian", "fedora", "rhel", "suse", "ubuntu", "freebsd", "openEuler"] %} distro: {{ variant }} {% else %} # Unknown/fallback distro. @@ -151,7 +151,7 @@ index 50e3bd8..e3816f2 100644 security: http://ports.ubuntu.com/ubuntu-ports ssh_svcname: ssh -{% elif variant in ["centos", "rhel", "fedora", "suse"] %} -+{% elif variant in ["centos", "rhel", "fedora", "suse", "euleros"] %} ++{% elif variant in ["centos", "rhel", "fedora", "suse", "openEuler"] %} # Default user name + that default users groups (if added/used) default_user: name: {{ variant }} @@ -164,7 +164,7 @@ index b92e8ab..f59d4fd 100644 After=networking.service {% endif %} -{% if variant in ["centos", "fedora", "redhat"] %} -+{% if variant in ["centos", "fedora", "redhat", "euleros"] %} ++{% if variant in ["centos", "fedora", "redhat", "openEuler"] %} After=network.service {% endif %} {% if variant in ["suse"] %} @@ -173,11 +173,11 @@ index 4357fbb..7d3034d 100644 --- a/tests/cloud_tests/util.py +++ b/tests/cloud_tests/util.py @@ -18,7 +18,7 @@ from tests.cloud_tests import LOG - + OS_FAMILY_MAPPING = { 'debian': ['debian', 'ubuntu'], - 'redhat': ['centos', 'rhel', 'fedora'], -+ 'redhat': ['centos', 'rhel', 'fedora', 'euleros'], ++ 'redhat': ['centos', 'rhel', 'fedora', 'openEuler'], 'gentoo': ['gentoo'], 'freebsd': ['freebsd'], 'suse': ['sles'], @@ -190,7 +190,7 @@ index 3abe578..78548cc 100644 } ntp_conf = self.tmp_path('ntp.conf', self.new_root) # Doesn't exist - for distro in ('debian', 'ubuntu', 'fedora', 'rhel', 'sles'): -+ for distro in ('debian', 'ubuntu', 'fedora', 'rhel', 'sles', 'euleros'): ++ for distro in ('debian', 'ubuntu', 'fedora', 'rhel', 'sles', 'openEuler'): mycloud = self._get_cloud(distro) root_dir = dirname(dirname(os.path.realpath(util.__file__))) tmpl_file = os.path.join( @@ -201,17 +201,17 @@ index 91d074b..7a8a2c4 100755 @@ -4,7 +4,7 @@ import argparse import os import sys - + -VARIANTS = ["bsd", "centos", "fedora", "rhel", "suse", "ubuntu", "unknown"] -+VARIANTS = ["bsd", "centos", "fedora", "rhel", "suse", "ubuntu", "unknown", "euleros"] - ++VARIANTS = ["bsd", "centos", "fedora", "rhel", "suse", "ubuntu", "unknown", "openEuler"] + if "avoid-pep8-E402-import-not-top-of-file": _tdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) -diff --git a/cloudinit/distros/euleros.py b/cloudinit/distros/euleros.py +diff --git a/cloudinit/distros/openEuler.py b/cloudinit/distros/openEuler.py new file mode 100644 index 0000000..5ac4700 --- /dev/null -+++ b/cloudinit/distros/euleros.py ++++ b/cloudinit/distros/openEuler.py @@ -0,0 +1,12 @@ +# Copyright (c) Huawei Technologies Co., Ltd. 2019-2019. All rights reserved. +# This file is part of cloud-init. See LICENSE file for license information. diff --git a/cloud-init.spec b/cloud-init.spec index 913686c..6be4dc7 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,6 +1,6 @@ Name: cloud-init Version: 17.1 -Release: 10 +Release: 11 Summary: the defacto multi-distribution package that handles early initialization of a cloud instance. License: ASL 2.0 or GPLv3 URL: http://launchpad.net/cloud-init @@ -21,7 +21,7 @@ Patch6005: Fix-ssh-keys-validation-in-ssh_util.patch Patch6006: stages-fix-tracebacks-if-a-module-stage-is-undefined.patch Patch6007: stages-Fix-bug-causing-datasource-to-have-incorrect-.patch -Patch9000: bugfix-cloud-init-add-euleros-os.patch +Patch9000: bugfix-cloud-init-add-openEuler-os.patch Patch9001: bugfix-sort-requirements.patch Patch9002: add-variable-to-forbid-tmp-dir.patch @@ -58,15 +58,15 @@ sed -i 's/\/etc\/redhat-release/\/etc\/%{_vendor}-release/g' setup.py %install %py3_install -- --init-system=systemd -python3 tools/render-cloudcfg --variant euleros > %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg +python3 tools/render-cloudcfg --variant openEuler > %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg install -d %{buildroot}/var/lib/cloud install -d %{buildroot}/run/%{name} install -D -m 0644 %{SOURCE1} %{buildroot}/%{_tmpfilesdir}/%{name}.conf install -D -m 0644 tools/21-cloudinit.conf %{buildroot}/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf %check -#remove test_handler_ntp.py rm -f $RPM_BUILD_DIR/%{name}-%{version}/tests/unittests/test_handler/test_handler_ntp.py +rm -f $RPM_BUILD_DIR/%{name}-%{version}/tests/unittests/test_datasource/test_opennebula.py nosetests-%{python3_version} tests/unittests/ @@ -128,6 +128,12 @@ fi %exclude /usr/share/doc/* %changelog +* Mon Dec 23 2019 chengquan - 17.1-11 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:add openEuler into distros + * Thu Oct 31 2019 chengquan - 17.1-10 - Type:bugfix - ID:NA