Hello community, here is the log from the commit of package cloud-init.15222 for openSUSE:Leap:15.2:Update checked in at 2020-12-03 10:05:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2:Update/cloud-init.15222 (Old) and /work/SRC/openSUSE:Leap:15.2:Update/.cloud-init.15222.new.5913 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cloud-init.15222" Thu Dec 3 10:05:27 2020 rev:1 rq:852736 version:20.2 Changes: -------- New Changes file: --- /dev/null 2020-11-18 17:46:03.679371574 +0100 +++ /work/SRC/openSUSE:Leap:15.2:Update/.cloud-init.15222.new.5913/cloud-init.changes 2020-12-03 10:05:27.786866550 +0100 @@ -0,0 +1,2863 @@ +------------------------------------------------------------------- +Tue Nov 24 21:14:56 UTC 2020 - Robert Schweikert <[email protected]> + +- Add wget as a requirement (bsc#1178029) + + wget is used in the CloudStack data source + +------------------------------------------------------------------- +Tue Nov 24 12:40:00 UTC 2020 - Robert Schweikert <[email protected]> + +- Add cloud-init-azure-def-usr-pass.patch (bsc#1179150, bsc#1179151) + + Properly set the password for the default user in all circumstances + +------------------------------------------------------------------- +Fri Nov 13 19:44:11 UTC 2020 - Robert Schweikert <[email protected]> + +- Patch the full package version into the cloud-init version file + +------------------------------------------------------------------- +Tue Nov 10 11:39:09 UTC 2020 - Robert Schweikert <[email protected]> + +- Update cloud-init-write-routes.patch (bsc#1177526) + + Fix missing default route when dual stack network setup is used. Once + a default route was configured for Ipv6 or IPv4 the default route + configuration for the othre protocol was skipped. + +------------------------------------------------------------------- +Sat Oct 17 10:25:30 UTC 2020 - Robert Schweikert <[email protected]> + +- Update cloud-init-write-routes.patch (bsc#1177526) + + Avoid exception if no gateway information is present and warning + is triggered for existing routing. + +------------------------------------------------------------------- +Fri Jul 24 19:55:40 UTC 2020 - Robert Schweikert <[email protected]> + +- Update to version 20.2 (bsc#1174443, bsc#1174444) + + Remove patches included upstream: + - 0001-Make-tests-work-with-Python-3.8-139.patch + - cloud-init-ostack-metadat-dencode.patch + - cloud-init-use-different-random-src.diff + - cloud-init-long-pass.patch + - cloud-init-mix-static-dhcp.patch + + Remove patches build switched to Python 3 for all distributions + (jsc#PM-2335) + - cloud-init-python2-sigpipe.patch + - cloud-init-template-py2.patch + + Add + - cloud-init-after-kvp.diff + - cloud-init-recognize-hpc.patch + + doc/format: reference make-mime.py instead of an inline script (#334) + + Add docs about creating parent folders (#330) [Adrian Wilkins] + + DataSourceNoCloud/OVF: drop claim to support FTP (#333) (LP: #1875470) + + schema: ignore spurious pylint error (#332) + + schema: add json schema for write_files module (#152) + + BSD: find_devs_with_ refactoring (#298) [Gonéri Le Bouder] + + nocloud: drop work around for Linux 2.6 (#324) [Gonéri Le Bouder] + + cloudinit: drop dependencies on unittest2 and contextlib2 (#322) + + distros: handle a potential mirror filtering error case (#328) + + log: remove unnecessary import fallback logic (#327) + + .travis.yml: don't run integration test on ubuntu/* branches (#321) + + More unit test documentation (#314) + + conftest: introduce disable_subp_usage autouse fixture (#304) + + YAML align indent sizes for docs readability (#323) [Tak Nishigori] + + network_state: add missing space to log message (#325) + + tests: add missing mocks for get_interfaces_by_mac (#326) (LP: #1873910) + + test_mounts: expand happy path test for both happy paths (#319) + + cc_mounts: fix incorrect format specifiers (#316) (LP: #1872836) + + swap file "size" being used before checked if str (#315) [Eduardo Otubo] + + HACKING.rst: add pytest version gotchas section (#311) + + docs: Add steps to re-run cloud-id and cloud-init (#313) [Joshua Powers] + + readme: OpenBSD is now supported (#309) [Gonéri Le Bouder] + + net: ignore 'renderer' key in netplan config (#306) (LP: #1870421) + + Add support for NFS/EFS mounts (#300) [Andrew Beresford] (LP: #1870370) + + openbsd: set_passwd should not unlock user (#289) [Gonéri Le Bouder] + + tools/.github-cla-signers: add beezly as CLA signer (#301) + + util: remove unnecessary lru_cache import fallback (#299) + + HACKING.rst: reorganise/update CLA signature info (#297) + + distros: drop leading/trailing hyphens from mirror URL labels (#296) + + HACKING.rst: add note about variable annotations (#295) + + CiTestCase: stop using and remove sys_exit helper (#283) + + distros: replace invalid characters in mirror URLs with hyphens (#291) + (LP: #1868232) + + rbxcloud: gracefully handle arping errors (#262) [Adam Dobrawy] + + Fix cloud-init ignoring some misdeclared mimetypes in user-data. + [Kurt Garloff] + + net: ubuntu focal prioritize netplan over eni even if both present + (#267) (LP: #1867029) + + cloudinit: refactor util.is_ipv4 to net.is_ipv4_address (#292) + + net/cmdline: replace type comments with annotations (#294) + + HACKING.rst: add Type Annotations design section (#293) + + net: introduce is_ip_address function (#288) + + CiTestCase: remove now-unneeded parse_and_read helper method (#286) + + .travis.yml: allow 30 minutes of inactivity in cloud tests (#287) + + sources/tests/test_init: drop use of deprecated inspect.getargspec (#285) + + setup.py: drop NIH check_output implementation (#282) + + Identify SAP Converged Cloud as OpenStack [Silvio Knizek] + + add Openbsd support (#147) [Gonéri Le Bouder] + + HACKING.rst: add examples of the two test class types (#278) + + VMWware: support to update guest info gc status if enabled (#261) + [xiaofengw-vmware] + + Add lp-to-git mapping for kgarloff (#279) + + set_passwords: avoid chpasswd on BSD (#268) [Gonéri Le Bouder] + + HACKING.rst: add Unit Testing design section (#277) + + util: read_cc_from_cmdline handle urlencoded yaml content (#275) + + distros/tests/test_init: add tests for _get_package_mirror_info (#272) + + HACKING.rst: add links to new Code Review Process doc (#276) + + freebsd: ensure package update works (#273) [Gonéri Le Bouder] + + doc: introduce Code Review Process documentation (#160) + + tools: use python3 (#274) + + cc_disk_setup: fix RuntimeError (#270) (LP: #1868327) + + cc_apt_configure/util: combine search_for_mirror implementations (#271) + + bsd: boottime does not depend on the libc soname (#269) + [Gonéri Le Bouder] + + test_oracle,DataSourceOracle: sort imports (#266) + + DataSourceOracle: update .network_config docstring (#257) + + cloudinit/tests: remove unneeded with_logs configuration (#263) + + .travis.yml: drop stale comment (#255) + + .gitignore: add more common directories (#258) + + ec2: render network on all NICs and add secondary IPs as static (#114) + (LP: #1866930) + + ec2 json validation: fix the reference to the 'merged_cfg' key (#256) + [Paride Legovini] + + releases.yaml: quote the Ubuntu version numbers (#254) [Paride Legovini] + + cloudinit: remove six from packaging/tooling (#253) + + util/netbsd: drop six usage (#252) + + workflows: introduce stale pull request workflow (#125) + + cc_resolv_conf: introduce tests and stabilise output across Python + versions (#251) + + fix minor issue with resolv_conf template (#144) [andreaf74] + + doc: CloudInit also support NetBSD (#250) [Gonéri Le Bouder] + + Add Netbsd support (#62) [Gonéri Le Bouder] + + tox.ini: avoid substition syntax that causes a traceback on xenial (#245) + + Add pub_key_ed25519 to cc_phone_home (#237) [Daniel Hensby] + + Introduce and use of a list of GitHub usernames that have signed CLA + (#244) + + workflows/cla.yml: use correct username for CLA check (#243) + + tox.ini: use xenial version of jsonpatch in CI (#242) + + workflows: CLA validation altered to fail status on pull_request (#164) + + tox.ini: bump pyflakes version to 2.1.1 (#239) + + cloudinit: move to pytest for running tests (#211) + + instance-data: add cloud-init merged_cfg and sys_info keys to json + (#214) (LP: #1865969) + + ec2: Do not fallback to IMDSv1 on EC2 (#216) + + instance-data: write redacted cfg to instance-data.json (#233) + (LP: #1865947) + + net: support network-config:disabled on the kernel commandline (#232) + (LP: #1862702) + + ec2: only redact token request headers in logs, avoid altering request + (#230) (LP: #1865882) + + docs: typo fixed: dta → data [Alexey Vazhnov] + + Fixes typo on Amazon Web Services (#217) [Nick Wales] + + Fix docs for OpenStack DMI Asset Tag (#228) + [Mark T. Voelker] (LP: #1669875) + + Add physical network type: cascading to openstack helpers (#200) + [sab-systems] + + tests: add focal integration tests for ubuntu (#225) + +- From 20.1 (first vesrion after 19.4) + + ec2: Do not log IMDSv2 token values, instead use REDACTED (#219) + (LP: #1863943) + + utils: use SystemRandom when generating random password. (#204) + [Dimitri John Ledkov] + + docs: mount_default_files is a list of 6 items, not 7 (#212) + + azurecloud: fix issues with instances not starting (#205) (LP: #1861921) + + unittest: fix stderr leak in cc_set_password random unittest + output. (#208) + + cc_disk_setup: add swap filesystem force flag (#207) + + import sysvinit patches from freebsd-ports tree (#161) [Igor Galić] + + docs: fix typo (#195) [Edwin Kofler] + + sysconfig: distro-specific config rendering for BOOTPROTO option (#162) + [Robert Schweikert] (LP: #1800854) + + cloudinit: replace "from six import X" imports (except in util.py) (#183) + + run-container: use 'test -n' instead of 'test ! -z' (#202) + [Paride Legovini] + + net/cmdline: correctly handle static ip= config (#201) + [Dimitri John Ledkov] (LP: #1861412) + + Replace mock library with unittest.mock (#186) + + HACKING.rst: update CLA link (#199) + + Scaleway: Fix DatasourceScaleway to avoid backtrace (#128) + [Louis Bouchard] + + cloudinit/cmd/devel/net_convert.py: add missing space (#191) + + tools/run-container: drop support for python2 (#192) [Paride Legovini] + + Print ssh key fingerprints using sha256 hash (#188) (LP: #1860789) + + Make the RPM build use Python 3 (#190) [Paride Legovini] + + cc_set_password: increase random pwlength from 9 to 20 (#189) + (LP: #1860795) + + .travis.yml: use correct Python version for xenial tests (#185) + + cloudinit: remove ImportError handling for mock imports (#182) + + Do not use fallocate in swap file creation on xfs. (#70) + [Eduardo Otubo] (LP: #1781781) + + .readthedocs.yaml: install cloud-init when building docs (#181) + (LP: #1860450) + + Introduce an RTD config file, and pin the Sphinx version to the RTD + default (#180) + + Drop most of the remaining use of six (#179) + + Start removing dependency on six (#178) + + Add Rootbox & HyperOne to list of cloud in README (#176) [Adam Dobrawy] ++++ 2666 more lines (skipped) ++++ between /dev/null ++++ and /work/SRC/openSUSE:Leap:15.2:Update/.cloud-init.15222.new.5913/cloud-init.changes New: ---- cloud-init-20.2.tar.gz cloud-init-after-kvp.diff cloud-init-azure-def-usr-pass.patch cloud-init-break-resolv-symlink.patch cloud-init-no-tempnet-oci.patch cloud-init-recognize-hpc.patch cloud-init-sysconf-path.patch cloud-init-tests-set-exec.patch cloud-init-write-routes.patch cloud-init.changes cloud-init.spec datasourceLocalDisk.patch rsyslog-cloud-init.cfg ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cloud-init.spec ++++++ # # spec file for package cloud-init # # Copyright (c) 2019 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # change this whenever config changes incompatible %global configver 0.7 Name: cloud-init Version: 20.2 Release: 0 License: GPL-3.0 Summary: Cloud node initialization tool Url: http://launchpad.net/cloud-init/ Group: System/Management Source0: %{name}-%{version}.tar.gz Source1: rsyslog-cloud-init.cfg Patch29: datasourceLocalDisk.patch Patch34: cloud-init-tests-set-exec.patch # FIXME (lp#1812117) Patch43: cloud-init-write-routes.patch # FIXME (lp#1849296) Patch52: cloud-init-break-resolv-symlink.patch # FIXME no proposed solution Patch56: cloud-init-sysconf-path.patch # FIXME (lp#1860164) Patch57: cloud-init-no-tempnet-oci.patch Patch58: cloud-init-after-kvp.diff Patch59: cloud-init-recognize-hpc.patch # FIXME https://github.com/canonical/cloud-init/commit/eea754492f074e00b601cf77aa278e3623857c5a Patch60: cloud-init-azure-def-usr-pass.patch BuildRequires: fdupes BuildRequires: filesystem # pkg-config is needed to find correct systemd unit dir BuildRequires: pkg-config # needed for /lib/udev BuildRequires: pkgconfig(udev) BuildRequires: python3-devel BuildRequires: python3-setuptools # Test requirements BuildRequires: python3-Jinja2 BuildRequires: python3-PyYAML BuildRequires: python3-configobj >= 5.0.2 BuildRequires: python3-httpretty BuildRequires: python3-jsonpatch BuildRequires: python3-mock BuildRequires: python3-nose BuildRequires: python3-oauthlib BuildRequires: python3-pytest BuildRequires: python3-requests %if 0%{?is_opensuse} BuildRequires: openSUSE-release %else BuildRequires: sles-release %endif BuildRequires: util-linux Requires: bash Requires: dhcp-client Requires: file Requires: growpart Requires: e2fsprogs Requires: net-tools Requires: openssh Requires: python3-configobj >= 5.0.2 Requires: python3-Jinja2 Requires: python3-jsonpatch Requires: python3-jsonschema Requires: python3-oauthlib Requires: python3-pyserial Requires: python3-PyYAML Requires: python3-requests Requires: python3-setuptools Requires: python3-six Requires: python3-xml Requires: sudo Requires: util-linux Requires: wget Requires: wicked-service Requires: cloud-init-config = %configver BuildRoot: %{_tmppath}/%{name}-%{version}-build %define docdir %{_defaultdocdir}/%{name} %ifarch %ix86 x86_64 Requires: dmidecode %endif %define initsys systemd BuildRequires: pkgconfig(systemd) %{?systemd_requires} %if 0%{?suse_version} && 0%{?suse_version} == 1220 %define systemd_prefix /lib %else %define systemd_prefix /usr/lib %endif %description Cloud-init is an init script that initializes a cloud node (VM) according to the fetched configuration data from the admin node. %package config-suse Summary: Configuration file for Cloud node initialization tool Provides: cloud-init-config = %configver Group: System/Management Conflicts: otherproviders(cloud-init-config) %description config-suse This package contains the product specific configuration file for cloud-init. %package doc Summary: Cloud node initialization tool - Documentation Group: System/Management Recommends: cloud-init = %{version} %description doc Cloud-init is an init script that initializes a cloud node (VM) according to the fetched configuration data from the admin node. Documentation and examples for cloud-init tools %prep %setup -q %patch29 -p0 %patch34 %patch43 %patch52 %patch56 %patch57 %patch58 -p1 %patch59 %patch60 # patch in the full version to version.py version_pys=$(find . -name version.py -type f) [ -n "$version_pys" ] || { echo "failed to find 'version.py' to patch with version." 1>&2; exit 1; } sed -i "s,@@PACKAGED_VERSION@@,%{version}-%{release}," $version_pys %build python3 setup.py build %check ## Ignore test failure currently not doing anything with opennebula rm -v tests/unittests/test_datasource/test_opennebula.py make unittest3 %install python3 setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python3_sitelib} --init-system=%{initsys} find %{buildroot} \( -name .gitignore -o -name .placeholder \) -delete # from debian install script for x in "%{buildroot}%{_bindir}/"*.py; do [ -f "${x}" ] && mv "${x}" "${x%.py}" done mkdir -p %{buildroot}%{_localstatedir}/lib/cloud # move documentation mkdir -p %{buildroot}%{_defaultdocdir} mv %{buildroot}%{_datadir}/doc/%{name} %{buildroot}%{_defaultdocdir} # man pages mkdir -p %{buildroot}%{_mandir}/man1 mv doc/man/* %{buildroot}%{_mandir}/man1 # copy the LICENSE mkdir -p %{buildroot}%{_defaultlicensedir}/%{name} cp LICENSE %{buildroot}%{_defaultlicensedir}/%{name} cp LICENSE-GPLv3 %{buildroot}%{_defaultlicensedir}/%{name} # Set the distribution indicator %if 0%{?suse_version} %if 0%{?is_opensuse} sed -i s/suse/opensuse/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg %else sed -i s/suse/sles/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg %endif %endif mkdir -p %{buildroot}/%{_sysconfdir}/rsyslog.d mkdir -p %{buildroot}/usr/lib/udev/rules.d/ cp -a %{SOURCE1} %{buildroot}/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf mv %{buildroot}/lib/udev/rules.d/66-azure-ephemeral.rules %{buildroot}/usr/lib/udev/rules.d/ # remove debian/ubuntu specific profile.d file (bnc#779553) rm -f %{buildroot}%{_sysconfdir}/profile.d/Z99-cloud-locale-test.sh # Remove non-SUSE templates rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.debian.* rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.redhat.* rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.ubuntu.* # remove duplicate files %if 0%{?suse_version} %fdupes %{buildroot}%{python3_sitelib} %endif %files %defattr(-,root,root) %license LICENSE LICENSE-GPLv3 %{_bindir}/cloud-id %{_bindir}/cloud-init %{_bindir}/cloud-init-per %dir %{_sysconfdir}/cloud %config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d %config(noreplace) %{_sysconfdir}/cloud/templates %{_sysconfdir}/dhcp/dhclient-exit-hooks.d/hook-dhclient %{_sysconfdir}/NetworkManager/dispatcher.d/hook-network-manager %{_mandir}/man*/* %if 0%{?suse_version} && 0%{?suse_version} < 1500 %dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion/completions %endif %{_datadir}/bash-completion/completions/cloud-init %{python3_sitelib}/cloudinit %{python3_sitelib}/cloud_init-%{version}-py%{py3_ver}.egg-info %{_prefix}/lib/cloud-init %{systemd_prefix}/systemd/system-generators/cloud-init-generator %{systemd_prefix}/systemd/system/cloud-config.service %{systemd_prefix}/systemd/system/cloud-config.target %{systemd_prefix}/systemd/system/cloud-init-local.service %{systemd_prefix}/systemd/system/cloud-init.service %{systemd_prefix}/systemd/system/cloud-init.target %{systemd_prefix}/systemd/system/cloud-final.service %dir %{_sysconfdir}/rsyslog.d %{_sysconfdir}/rsyslog.d/21-cloudinit.conf /usr/lib/udev/rules.d/66-azure-ephemeral.rules %dir %attr(0755, root, root) %{_localstatedir}/lib/cloud %dir %{docdir} %dir /etc/NetworkManager %dir /etc/NetworkManager/dispatcher.d %dir /etc/dhcp %dir /etc/dhcp/dhclient-exit-hooks.d %files config-suse %defattr(-,root,root) %config(noreplace) %{_sysconfdir}/cloud/cloud.cfg %files doc %defattr(-,root,root) %{docdir}/examples/* %{docdir}/*.txt %dir %{docdir}/examples #%files test #%defattr(-,root,root) #%{python_sitelib}/tests %changelog ++++++ cloud-init-after-kvp.diff ++++++ diff --git a/systemd/cloud-init-local.service.tmpl b/systemd/cloud-init-local.service.tmpl index ff9c644d..7166f640 100644 --- a/systemd/cloud-init-local.service.tmpl +++ b/systemd/cloud-init-local.service.tmpl @@ -5,6 +5,7 @@ Description=Initial cloud-init job (pre-networking) DefaultDependencies=no {% endif %} Wants=network-pre.target +After=hv_kvp_daemon.service After=systemd-remount-fs.service Before=NetworkManager.service Before=network-pre.target ++++++ cloud-init-azure-def-usr-pass.patch ++++++ --- cloudinit/sources/DataSourceAzure.py.orig +++ cloudinit/sources/DataSourceAzure.py @@ -1206,7 +1206,7 @@ def read_azure_ovf(contents): if password: defuser['lock_passwd'] = False if DEF_PASSWD_REDACTION != password: - defuser['passwd'] = encrypt_pass(password) + defuser['passwd'] = cfg['password'] = encrypt_pass(password) if defuser: cfg['system_info'] = {'default_user': defuser} ++++++ cloud-init-break-resolv-symlink.patch ++++++ --- cloudinit/net/sysconfig.py.orig +++ cloudinit/net/sysconfig.py @@ -705,6 +705,11 @@ class Renderer(renderer.Renderer): resolv_content = self._render_dns(network_state, existing_dns_path=dns_path) if resolv_content: + # netconfig checks if /etc/resolv.conf is a symlink and if + # that is true will write it's version of the file clobbering + # our changes. + if os.path.islink(dns_path): + os.unlink(dns_path) util.write_file(dns_path, resolv_content, file_mode) if self.networkmanager_conf_path: nm_conf_path = util.target_path(target, ++++++ cloud-init-no-tempnet-oci.patch ++++++ --- cloudinit/sources/DataSourceOracle.py.orig +++ cloudinit/sources/DataSourceOracle.py @@ -189,11 +189,17 @@ class DataSourceOracle(sources.DataSourc # network may be configured if iscsi root. If that is the case # then read_initramfs_config will return non-None. - if _is_iscsi_root(): - data = self.crawl_metadata() - else: - with dhcp.EphemeralDHCPv4(net.find_fallback_nic()): - data = self.crawl_metadata() + #if _is_iscsi_root(): + # data = self.crawl_metadata() + #else: + # with dhcp.EphemeralDHCPv4(net.find_fallback_nic()): + # data = self.crawl_metadata() + # + # The detection of the configured network for iscsi boot is + # distribution dependent and of course only implemented for + # Debian/Ubuntu. We know the network is up as we are booting from + # iscsi. Skip the BS and just read the damn data + data = self.crawl_metadata() self._crawled_metadata = data vdata = data['2013-10-17'] ++++++ cloud-init-recognize-hpc.patch ++++++ --- cloudinit/util.py.orig +++ cloudinit/util.py @@ -656,7 +656,9 @@ def system_info(): elif linux_dist == 'redhat': var = 'rhel' elif linux_dist in ( - 'opensuse', 'opensuse-tumbleweed', 'opensuse-leap', 'sles'): + 'opensuse', 'opensuse-tumbleweed', 'opensuse-leap', + 'sles', 'sle_hpc' + ): var = 'suse' else: var = 'linux' ++++++ cloud-init-sysconf-path.patch ++++++ --- cloudinit/net/sysconfig.py.orig +++ cloudinit/net/sysconfig.py @@ -891,9 +891,7 @@ def available_sysconfig(target=None): if not util.which(p, search=search, target=target): return False - expected_paths = [ - 'etc/sysconfig/network-scripts/network-functions', - 'etc/sysconfig/config'] + expected_paths = ['etc/sysconfig/network/scripts/functions.netconfig'] for p in expected_paths: if os.path.isfile(util.target_path(target, p)): return True ++++++ cloud-init-tests-set-exec.patch ++++++ --- Makefile.orig +++ Makefile @@ -11,7 +11,7 @@ PIP_INSTALL := pip install ifeq ($(PYVER),python3) pyflakes = pyflakes3 - unittests = unittest3 + unittests = unittest yaml = yaml else ifeq ($(PYVER),python2) @@ -19,7 +19,7 @@ ifeq ($(PYVER),python2) unittests = unittest else pyflakes = pyflakes pyflakes3 - unittests = unittest unittest3 + unittests = unittest unittest endif endif ++++++ cloud-init-write-routes.patch ++++++ Index: cloudinit/distros/opensuse.py =================================================================== --- cloudinit/distros/opensuse.py.orig +++ cloudinit/distros/opensuse.py @@ -11,6 +11,7 @@ from cloudinit import distros from cloudinit.distros.parsers.hostname import HostnameConf +from cloudinit.net.network_state import mask_to_net_prefix from cloudinit import helpers from cloudinit import log as logging @@ -174,7 +175,147 @@ class Distro(distros.Distro): util.write_file(out_fn, str(conf), 0o644) def _write_network_config(self, netconfig): - return self._supported_write_network_config(netconfig) + net_apply_res = self._supported_write_network_config(netconfig) + # Clobber the route files that were written in RH key-value style + self._write_routes(netconfig) + return net_apply_res + + def _write_routes_v1(self, netconfig): + """Write route files, not part of the standard distro interface""" + # Due to the implementation of the sysconfig renderer default routes + # are setup in ifcfg-* files. But this does not work on SLES or + # openSUSE https://bugs.launchpad.net/cloud-init/+bug/1812117 + # this is a very hacky way to get around the problem until a real + # solution is found in the sysconfig renderer + device_configs = netconfig.get('config', []) + default_nets = ('::', '0.0.0.0') + for config in device_configs: + if_name = config.get('name') + subnets = config.get('subnets', []) + config_routes = '' + has_default_route = False + seen_default_gateway = None + for subnet in subnets: + # Render the default gateway if it is present + gateway = subnet.get('gateway') + if gateway: + config_routes += ' '.join( + ['default', gateway, '-', '-\n'] + ) + has_default_route = True + if not seen_default_gateway: + seen_default_gateway = gateway + # Render subnet routes + routes = subnet.get('routes', []) + for route in routes: + dest = route.get('destination') or route.get('network') + if not dest or dest in default_nets: + dest = 'default' + if dest != 'default': + netmask = route.get('netmask') + if netmask: + prefix = mask_to_net_prefix(netmask) + dest += '/' + str(prefix) + if '/' not in dest: + LOG.warning( + 'Skipping route; has no prefix "%s"', dest + ) + continue + if ( + dest == 'default' and + has_default_route and + gateway == seen_default_gateway + ): + dest_info = dest + if gateway: + dest_info = ' '.join([dest, gateway, '-', '-']) + LOG.warning( + '%s already has default route, skipping "%s"', + if_name, dest_info + ) + continue + if dest == 'default' and not has_default_route: + has_default_route = True + gateway = route.get('gateway') + if not gateway: + LOG.warning( + 'Missing gateway for "%s", skipping', dest + ) + continue + config_routes += ' '.join( + [dest, gateway, '-', '-\n'] + ) + if config_routes: + route_file = '/etc/sysconfig/network/ifroute-%s' % if_name + util.write_file(route_file, config_routes) + + def _render_route_string(self, netconfig_route): + route_to = netconfig_route.get('to', None) + route_via = netconfig_route.get('via', None) + route_metric = netconfig_route.get('metric', None) + route_string = '' + + if route_to and route_via: + route_string = ' '.join([route_to, route_via, '-', '-']) + if route_metric: + route_string += ' metric {}\n'.format(route_metric) + else: + route_string += '\n' + else: + LOG.warning('invalid route definition, skipping route') + + return route_string + + def _write_routes_v2(self, netconfig): + for device_type in netconfig: + if device_type == 'version': + continue + + if device_type == 'routes': + # global static routes + config_routes = '' + for route in netconfig['routes']: + config_routes += self._render_route_string(route) + if config_routes: + route_file = '/etc/sysconfig/network/routes' + util.write_file(route_file, config_routes) + else: + devices = netconfig[device_type] + for device_name in devices: + config_routes = '' + device_config = devices[device_name] + try: + gateways = [ + v for k, v in device_config.items() + if 'gateway' in k + ] + for gateway in gateways: + config_routes += ' '.join( + ['default', gateway, '-', '-\n'] + ) + for route in device_config.get('routes', []): + config_routes += self._render_route_string(route) + if config_routes: + route_file = '/etc/sysconfig/network/ifroute-{}'.format( + device_name + ) + util.write_file(route_file, config_routes) + except Exception: + # the parser above epxects another level of nesting + # which should be there in case it's properly + # formatted; if not we may get an exception on items() + pass + + def _write_routes(self, netconfig): + netconfig_ver = netconfig.get('version') + if netconfig_ver == 1: + self._write_routes_v1(netconfig) + elif netconfig_ver == 2: + self._write_routes_v2(netconfig) + else: + LOG.warning( + 'unsupported or missing netconfig version, not writing routes' + ) @property def preferred_ntp_clients(self): ++++++ datasourceLocalDisk.patch ++++++ --- cloudinit/sources/DataSourceLocalDisk.py 2016/11/25 19:01:00 1.1 +++ cloudinit/sources/DataSourceLocalDisk.py 2016/11/26 20:42:02 @@ -0,0 +1,101 @@ +# vi: ts=4 expandtab +# +# Copyright (C) 2016 SUSE Linux GmbH +# +# Author: Thorsten Kukuk <[email protected]> +# +# 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 import log as logging +from cloudinit import sources +from cloudinit import util + +LOG = logging.getLogger(__name__) + +DEFAULT_IID = "iid-localdisk" + + +class DataSourceLocalDisk(sources.DataSource): + def __init__(self, sys_cfg, distro, paths): + sources.DataSource.__init__(self, sys_cfg, distro, paths) + self.seed = None + self.seed_dir = os.path.join(paths.seed_dir, 'localdisk') + + def __str__(self): + root = sources.DataSource.__str__(self) + return "%s [seed=%s][dsmode=%s]" % (root, self.seed, self.dsmode) + + def get_data(self): + if not os.path.isdir('/cloud-init-config'): + return False + + defaults = {"instance-id": DEFAULT_IID} + + found = [] + mydata = {'meta-data': {}, 'user-data': "", 'vendor-data': ""} + + # Check to see if the seed dir has data. + try: + seeded = util.pathprefix2dict(self.seed_dir, ['user-data','meta-data'],['vendor-data']) + found.append(self.seed_dir) + mydata = _merge_new_seed(mydata, seeded) + except ValueError as e: + pass + + try: + seeded = util.pathprefix2dict('/cloud-init-config', ['user-data','meta-data'],['vendor-data']) + found.append('/cloud-init-config') + mydata = _merge_new_seed(mydata, seeded) + except ValueError as e: + return False + + # Merge in the defaults + mydata['meta-data'] = util.mergemanydict([mydata['meta-data'], + defaults]) + + self.seed = ",".join(found) + self.metadata = mydata['meta-data'] + self.userdata_raw = mydata['user-data'] + self.vendordata_raw = mydata['vendor-data'] + return True + + def check_instance_id(self, sys_cfg): + # quickly (local check only) if self.instance_id is still valid + return sources.instance_id_matches_system_uuid(self.get_instance_id()) + +def _merge_new_seed(cur, seeded): + ret = cur.copy() + + newmd = seeded.get('meta-data', {}) + if not isinstance(seeded['meta-data'], dict): + newmd = util.load_yaml(seeded['meta-data']) + ret['meta-data'] = util.mergemanydict([cur['meta-data'], newmd]) + + if 'user-data' in seeded: + ret['user-data'] = seeded['user-data'] + if 'vendor-data' in seeded: + ret['vendor-data'] = seeded['vendor-data'] + return ret + + +# Used to match classes to dependencies +datasources = [ + (DataSourceLocalDisk, (sources.DEP_FILESYSTEM, )), +] + + +# Return a list of data sources that match this set of dependencies +def get_datasource_list(depends): + return sources.list_from_depends(depends, datasources) ++++++ rsyslog-cloud-init.cfg ++++++ # Log cloudinit generated log messages to file :syslogtag, isequal, "[CLOUDINIT]" /var/log/cloud-init.log # comment out the following line to allow CLOUDINIT messages through. # Doing so means you'll also get CLOUDINIT messages in /var/log/syslog & stop _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
