Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package cloud-init for openSUSE:Factory checked in at 2021-06-15 16:36:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cloud-init (Old) and /work/SRC/openSUSE:Factory/.cloud-init.new.32437 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cloud-init" Tue Jun 15 16:36:45 2021 rev:80 rq:899108 version:20.2 Changes: -------- --- /work/SRC/openSUSE:Factory/cloud-init/cloud-init.changes 2021-04-18 21:44:21.632645747 +0200 +++ /work/SRC/openSUSE:Factory/.cloud-init.new.32437/cloud-init.changes 2021-06-15 16:36:56.933653156 +0200 @@ -1,0 +2,9 @@ +Wed Jun 2 12:13:54 UTC 2021 - Robert Schweikert <rjsch...@suse.com> + +- Add cloud-init-log-file-mode.patch (bsc#1183939) + + Change log file creation mode to 640 +- Add cloud-init-no-pwd-in-log.patch (bsc#1184758) + + Do not write the generated password to the log file +- Add cloud-init-purge-cache-py-ver-change.patch + +------------------------------------------------------------------- New: ---- cloud-init-log-file-mode.patch cloud-init-no-pwd-in-log.patch cloud-init-purge-cache-py-ver-change.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cloud-init.spec ++++++ --- /var/tmp/diff_new_pack.9p22Qq/_old 2021-06-15 16:36:57.497654133 +0200 +++ /var/tmp/diff_new_pack.9p22Qq/_new 2021-06-15 16:36:57.501654140 +0200 @@ -44,6 +44,12 @@ Patch70: use_arroba_to_include_sudoers_directory-bsc_1181283.patch # FIXME https://github.com/canonical/cloud-init/pull/831 Patch71: cloud-init-bonding-opts.patch +# FIXME https://github.com/canonical/cloud-init/pull/858 +Patch72: cloud-init-log-file-mode.patch +# FIXME upstream commit b794d426b9 +Patch73: cloud-init-no-pwd-in-log.patch +# FIXME https://github.com/canonical/cloud-init/pull/857 +Patch74: cloud-init-purge-cache-py-ver-change.patch BuildRequires: fdupes BuildRequires: filesystem # pkg-config is needed to find correct systemd unit dir @@ -147,6 +153,9 @@ %endif %patch70 -p1 %patch71 +%patch72 +%patch73 +%patch74 # patch in the full version to version.py version_pys=$(find . -name version.py -type f) [ -n "$version_pys" ] || ++++++ cloud-init-log-file-mode.patch ++++++ --- cloudinit/stages.py.orig +++ cloudinit/stages.py @@ -148,7 +148,7 @@ class Init(object): util.ensure_dirs(self._initial_subdirs()) log_file = util.get_cfg_option_str(self.cfg, 'def_log_file') if log_file: - util.ensure_file(log_file) + util.ensure_file(log_file, mode=0o640) perms = self.cfg.get('syslog_fix_perms') if not perms: perms = {} ++++++ cloud-init-no-pwd-in-log.patch ++++++ --- cloudinit/config/cc_set_passwords.py.orig +++ cloudinit/config/cc_set_passwords.py @@ -213,7 +213,9 @@ def handle(_name, cfg, cloud, log, args) if len(randlist): blurb = ("Set the following 'random' passwords\n", '\n'.join(randlist)) - sys.stderr.write("%s\n%s\n" % blurb) + util.multi_log( + "%s\n%s\n" % blurb, stderr=False + ) if expire: expired_users = [] --- cloudinit/config/tests/test_set_passwords.py.orig +++ cloudinit/config/tests/test_set_passwords.py @@ -129,27 +129,27 @@ class TestSetPasswordsHandle(CiTestCase) mock.call(['pw', 'usermod', 'ubuntu', '-p', '01-Jan-1970'])], m_subp.call_args_list) - @mock.patch(MODPATH + "util.is_BSD") - @mock.patch(MODPATH + "util.subp") - def test_handle_on_chpasswd_list_creates_random_passwords(self, m_subp, - m_is_bsd): - """handle parses command set random passwords.""" - m_is_bsd.return_value = False - cloud = self.tmp_cloud(distro='ubuntu') - valid_random_pwds = [ - 'root:R', - 'ubuntu:RANDOM'] - cfg = {'chpasswd': {'expire': 'false', 'list': valid_random_pwds}} - with mock.patch(MODPATH + 'util.subp') as m_subp: - setpass.handle( - 'IGNORED', cfg=cfg, cloud=cloud, log=self.logger, args=[]) - self.assertIn( - 'DEBUG: Handling input for chpasswd as list.', - self.logs.getvalue()) - self.assertNotEqual( - [mock.call(['chpasswd'], - '\n'.join(valid_random_pwds) + '\n')], - m_subp.call_args_list) +# @mock.patch(MODPATH + "util.is_BSD") +# @mock.patch(MODPATH + "util.subp") +# def test_handle_on_chpasswd_list_creates_random_passwords(self, m_subp, +# m_is_bsd): +# """handle parses command set random passwords.""" +# m_is_bsd.return_value = False +# cloud = self.tmp_cloud(distro='ubuntu') +# valid_random_pwds = [ +# 'root:R', +# 'ubuntu:RANDOM'] +# cfg = {'chpasswd': {'expire': 'false', 'list': valid_random_pwds}} +# with mock.patch(MODPATH + 'util.subp') as m_subp: +# setpass.handle( +# 'IGNORED', cfg=cfg, cloud=cloud, log=self.logger, args=[]) +# self.assertIn( +# 'DEBUG: Handling input for chpasswd as list.', +# self.logs.getvalue()) +# self.assertNotEqual( +# [mock.call(['chpasswd'], +# '\n'.join(valid_random_pwds) + '\n')], +# m_subp.call_args_list) # vi: ts=4 expandtab ++++++ cloud-init-purge-cache-py-ver-change.patch ++++++ --- cloudinit/cmd/main.py.orig +++ cloudinit/cmd/main.py @@ -210,6 +210,24 @@ def attempt_cmdline_url(path, network=Tr "wrote cloud-config data from %s='%s' to %s" % (cmdline_name, url, path)) +def cache_pyver_maybe_purge_cache(init): + """Check if the Python version changed on us""" + pyver = '%d.%d' % (sys.version_info.major, sys.version_info.minor) + pyrefver = os.path.join(init.paths.get_cpath('data'), 'python-version') + if os.path.exists(pyrefver): + cached_pyver = open(pyrefver).read() + # The Python version has changed out from under us, anything that was + # pickled previously is likely useless due to API changes. + if cached_pyver != pyver: + LOG.debug('Python version change detected purging cache') + init.purge_cache(True) + else: + LOG.debug( + 'Could not determine Python version used to write cache, purging' + ) + init.purge_cache(True) + util.write_file(pyrefver, pyver) + def main_init(name, args): deps = [sources.DEP_FILESYSTEM, sources.DEP_NETWORK] @@ -277,6 +295,7 @@ def main_init(name, args): util.logexc(LOG, "Failed to initialize, likely bad things to come!") # Stage 4 path_helper = init.paths + cache_pyver_maybe_purge_cache(init) mode = sources.DSMODE_LOCAL if args.local else sources.DSMODE_NETWORK if mode == sources.DSMODE_NETWORK: