Hello community, here is the log from the commit of package salt for openSUSE:Leap:15.2 checked in at 2020-02-16 18:25:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/salt (Old) and /work/SRC/openSUSE:Leap:15.2/.salt.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "salt" Sun Feb 16 18:25:56 2020 rev:65 rq:772172 version:2019.2.3 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/salt/salt.changes 2020-02-04 17:53:35.364719200 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.salt.new.26092/salt.changes 2020-02-16 18:26:00.946645606 +0100 @@ -1,0 +2,18 @@ +Mon Feb 3 10:42:42 UTC 2020 - Jochen Breuer <[email protected]> + +- Update to Salt version 2019.2.3 (CVE-2019-17361) + See release notes: https://docs.saltstack.com/en/latest/topics/releases/2019.2.3.html + +- Modified: + * use-adler32-algorithm-to-compute-string-checksums.patch + +------------------------------------------------------------------- +Wed Jan 29 15:38:36 UTC 2020 - Jochen Breuer <[email protected]> + +- Enable passing grains to start event based on 'start_event_grains' configuration parameter + +- Added: + * restrict-the-start_event_grains-only-to-the-start-ev.patch + * enable-passing-grains-to-start-event-based-on-start_.patch + +------------------------------------------------------------------- Old: ---- v2019.2.2.tar.gz New: ---- enable-passing-grains-to-start-event-based-on-start_.patch restrict-the-start_event_grains-only-to-the-start-ev.patch v2019.2.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ salt.spec ++++++ --- /var/tmp/diff_new_pack.ophw5d/_old 2020-02-16 18:26:02.878646618 +0100 +++ /var/tmp/diff_new_pack.ophw5d/_new 2020-02-16 18:26:02.878646618 +0100 @@ -58,7 +58,7 @@ %bcond_with builddocs Name: salt -Version: 2019.2.2 +Version: 2019.2.3 Release: 0 Summary: A parallel remote execution system License: Apache-2.0 @@ -288,6 +288,10 @@ Patch103: list_downloaded-for-apt-module.patch # PATCH_FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/200 Patch104: support-for-btrfs-and-xfs-in-parted-and-mkfs.patch +# PATCH_FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/204 +Patch105: enable-passing-grains-to-start-event-based-on-start_.patch +# PATCH_FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/205 +Patch106: restrict-the-start_event_grains-only-to-the-start-ev.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: logrotate @@ -801,7 +805,7 @@ %prep # %setup -q -n salt-%{version} -%setup -q -n salt-2019.2.2-suse +%setup -q -n salt-2019.2.3-suse cp %{S:1} . cp %{S:5} ./.travis.yml %patch1 -p1 @@ -908,6 +912,8 @@ %patch102 -p1 %patch103 -p1 %patch104 -p1 +%patch105 -p1 +%patch106 -p1 %build %if 0%{?build_py2} ++++++ _lastrevision ++++++ --- /var/tmp/diff_new_pack.ophw5d/_old 2020-02-16 18:26:02.946646653 +0100 +++ /var/tmp/diff_new_pack.ophw5d/_new 2020-02-16 18:26:02.946646653 +0100 @@ -1 +1 @@ -d3f65020201314619013243463c3fe8098529e3e \ No newline at end of file +e44665e8c48cfb6d2c3ef0189e3712e474ddbff6 \ No newline at end of file ++++++ _service ++++++ --- /var/tmp/diff_new_pack.ophw5d/_old 2020-02-16 18:26:02.962646662 +0100 +++ /var/tmp/diff_new_pack.ophw5d/_new 2020-02-16 18:26:02.966646664 +0100 @@ -3,7 +3,7 @@ <param name="url">https://github.com/openSUSE/salt-packaging.git</param> <param name="subdir">salt</param> <param name="filename">package</param> - <param name="revision">2019.2.2</param> + <param name="revision">2019.2.3</param> <param name="scm">git</param> </service> <service name="extract_file" mode="disabled"> @@ -12,8 +12,8 @@ </service> <service name="download_url" mode="disabled"> <param name="host">codeload.github.com</param> - <param name="path">openSUSE/salt/tar.gz/v2019.2.2-suse</param> - <param name="filename">v2019.2.2.tar.gz</param> + <param name="path">openSUSE/salt/tar.gz/v2019.2.3-suse</param> + <param name="filename">v2019.2.3.tar.gz</param> </service> <service name="update_changelog" mode="disabled"></service> </services> ++++++ enable-passing-grains-to-start-event-based-on-start_.patch ++++++ >From 79f566ba99f48d60e4948c9b8df9c6b6f497eced Mon Sep 17 00:00:00 2001 From: Abid Mehmood <[email protected]> Date: Thu, 1 Aug 2019 13:14:22 +0200 Subject: [PATCH] enable passing grains to start event based on 'start_event_grains' configuration parameter unit tests --- conf/minion | 5 +++++ doc/ref/configuration/minion.rst | 15 +++++++++++++++ salt/config/__init__.py | 1 + salt/minion.py | 5 +++++ tests/unit/test_minion.py | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 58 insertions(+) diff --git a/conf/minion b/conf/minion index f2b6655932..cc7e962120 100644 --- a/conf/minion +++ b/conf/minion @@ -548,6 +548,11 @@ # - edit.vim # - hyper # +# List of grains to pass in start event when minion starts up: +#start_event_grains: +# - machine_id +# - uuid +# # Top file to execute if startup_states is 'top': #top_file: '' diff --git a/doc/ref/configuration/minion.rst b/doc/ref/configuration/minion.rst index 30343ebd8e..fe556ef9ce 100644 --- a/doc/ref/configuration/minion.rst +++ b/doc/ref/configuration/minion.rst @@ -2000,6 +2000,21 @@ List of states to run when the minion starts up if ``startup_states`` is set to - edit.vim - hyper +.. conf_minion:: start_event_grains + +``start_event_grains`` +---------------------- + +Default: ``[]`` + +List of grains to pass in start event when minion starts up. + +.. code-block:: yaml + + start_event_grains: + - machine_id + - uuid + .. conf_minion:: top_file ``top_file`` diff --git a/salt/config/__init__.py b/salt/config/__init__.py index ee90eb3120..788128b903 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -1283,6 +1283,7 @@ DEFAULT_MINION_OPTS = { 'state_top_saltenv': None, 'startup_states': '', 'sls_list': [], + 'start_event_grains': [], 'top_file': '', 'thoriumenv': None, 'thorium_top': 'top.sls', diff --git a/salt/minion.py b/salt/minion.py index 2c0a18604e..2b53da4f18 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1456,6 +1456,11 @@ class Minion(MinionBase): else: return + if self.opts['start_event_grains']: + grains_to_add = dict( + [(k, v) for k, v in six.iteritems(self.opts.get('grains', {})) if k in self.opts['start_event_grains']]) + load['grains'] = grains_to_add + if sync: try: self._send_req_sync(load, timeout) diff --git a/tests/unit/test_minion.py b/tests/unit/test_minion.py index b78e0f6abd..83215151ee 100644 --- a/tests/unit/test_minion.py +++ b/tests/unit/test_minion.py @@ -305,6 +305,38 @@ class MinionTestCase(TestCase, AdaptedConfigurationTestCaseMixin): finally: minion.destroy() + def test_when_passed_start_event_grains(self): + mock_opts = self.get_config('minion', from_scratch=True) + mock_opts['start_event_grains'] = ["os"] + io_loop = tornado.ioloop.IOLoop() + io_loop.make_current() + minion = salt.minion.Minion(mock_opts, io_loop=io_loop) + try: + minion.tok = MagicMock() + minion._send_req_sync = MagicMock() + minion._fire_master('Minion has started', 'minion_start') + load = minion._send_req_sync.call_args[0][0] + + self.assertTrue('grains' in load) + self.assertTrue('os' in load['grains']) + finally: + minion.destroy() + + def test_when_not_passed_start_event_grains(self): + mock_opts = self.get_config('minion', from_scratch=True) + io_loop = tornado.ioloop.IOLoop() + io_loop.make_current() + minion = salt.minion.Minion(mock_opts, io_loop=io_loop) + try: + minion.tok = MagicMock() + minion._send_req_sync = MagicMock() + minion._fire_master('Minion has started', 'minion_start') + load = minion._send_req_sync.call_args[0][0] + + self.assertTrue('grains' not in load) + finally: + minion.destroy() + def test_minion_retry_dns_count(self): ''' Tests that the resolve_dns will retry dns look ups for a maximum of -- 2.16.4 ++++++ restrict-the-start_event_grains-only-to-the-start-ev.patch ++++++ >From 127f0fa48ed2e5f05320c6c82f928f0d59a94bd9 Mon Sep 17 00:00:00 2001 From: Abid Mehmood <[email protected]> Date: Thu, 16 Jan 2020 11:28:04 +0100 Subject: [PATCH] Restrict the 'start_event_grains' only to the start events add test for custom events --- salt/minion.py | 11 ++++++++--- tests/unit/test_minion.py | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/salt/minion.py b/salt/minion.py index 2b53da4f18..a2fb203bfe 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1437,7 +1437,7 @@ class Minion(MinionBase): finally: channel.close() - def _fire_master(self, data=None, tag=None, events=None, pretag=None, timeout=60, sync=True, timeout_handler=None): + def _fire_master(self, data=None, tag=None, events=None, pretag=None, timeout=60, sync=True, timeout_handler=None, include_startup_grains=False): ''' Fire an event on the master, or drop message if unable to send. ''' @@ -1456,7 +1456,7 @@ class Minion(MinionBase): else: return - if self.opts['start_event_grains']: + if include_startup_grains: grains_to_add = dict( [(k, v) for k, v in six.iteritems(self.opts.get('grains', {})) if k in self.opts['start_event_grains']]) load['grains'] = grains_to_add @@ -2149,6 +2149,9 @@ class Minion(MinionBase): }) def _fire_master_minion_start(self): + include_grains = False + if self.opts['start_event_grains']: + include_grains = True # Send an event to the master that the minion is live if self.opts['enable_legacy_startup_events']: # Old style event. Defaults to False in Sodium release. @@ -2157,7 +2160,8 @@ class Minion(MinionBase): self.opts['id'], time.asctime() ), - 'minion_start' + 'minion_start', + include_startup_grains=include_grains ) # send name spaced event self._fire_master( @@ -2166,6 +2170,7 @@ class Minion(MinionBase): time.asctime() ), tagify([self.opts['id'], 'start'], 'minion'), + include_startup_grains=include_grains ) def module_refresh(self, force_refresh=False, notify=False): diff --git a/tests/unit/test_minion.py b/tests/unit/test_minion.py index 83215151ee..41dfab0f45 100644 --- a/tests/unit/test_minion.py +++ b/tests/unit/test_minion.py @@ -314,7 +314,7 @@ class MinionTestCase(TestCase, AdaptedConfigurationTestCaseMixin): try: minion.tok = MagicMock() minion._send_req_sync = MagicMock() - minion._fire_master('Minion has started', 'minion_start') + minion._fire_master('Minion has started', 'minion_start', include_startup_grains=True) load = minion._send_req_sync.call_args[0][0] self.assertTrue('grains' in load) @@ -337,6 +337,22 @@ class MinionTestCase(TestCase, AdaptedConfigurationTestCaseMixin): finally: minion.destroy() + def test_when_other_events_fired_and_start_event_grains_are_set(self): + mock_opts = self.get_config('minion', from_scratch=True) + mock_opts['start_event_grains'] = ["os"] + io_loop = tornado.ioloop.IOLoop() + io_loop.make_current() + minion = salt.minion.Minion(mock_opts, io_loop=io_loop) + try: + minion.tok = MagicMock() + minion._send_req_sync = MagicMock() + minion._fire_master('Custm_event_fired', 'custom_event') + load = minion._send_req_sync.call_args[0][0] + + self.assertTrue('grains' not in load) + finally: + minion.destroy() + def test_minion_retry_dns_count(self): ''' Tests that the resolve_dns will retry dns look ups for a maximum of -- 2.16.4 ++++++ use-adler32-algorithm-to-compute-string-checksums.patch ++++++ --- /var/tmp/diff_new_pack.ophw5d/_old 2020-02-16 18:26:03.214646793 +0100 +++ /var/tmp/diff_new_pack.ophw5d/_new 2020-02-16 18:26:03.214646793 +0100 @@ -1,4 +1,4 @@ -From 815042712007e3bc9e5326b3a13b2880534630b9 Mon Sep 17 00:00:00 2001 +From c1e2410749479940275a217d598b22b24eef8758 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk <[email protected]> Date: Sat, 28 Jul 2018 22:59:04 +0200 Subject: [PATCH] Use Adler32 algorithm to compute string checksums @@ -20,13 +20,13 @@ 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/salt/config/__init__.py b/salt/config/__init__.py -index b3dfc8e43d..ee90eb3120 100644 +index f4496f3a61..b272610fa4 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py -@@ -1217,6 +1217,10 @@ VALID_OPTS = { - - # Thorium top file location - 'thorium_top': six.string_types, +@@ -1221,6 +1221,10 @@ VALID_OPTS = { + # Allow raw_shell option when using the ssh + # client via the Salt API + 'netapi_allow_raw_shell': bool, + + # Use Adler32 hashing algorithm for server_id (default False until Sodium, "adler32" after) + # Possible values are: False, adler32, crc32 @@ -34,7 +34,7 @@ } # default configurations -@@ -1525,7 +1529,8 @@ DEFAULT_MINION_OPTS = { +@@ -1529,7 +1533,8 @@ DEFAULT_MINION_OPTS = { }, 'discovery': False, 'schedule': {}, ++++++ v2019.2.2.tar.gz -> v2019.2.3.tar.gz ++++++ /work/SRC/openSUSE:Leap:15.2/salt/v2019.2.2.tar.gz /work/SRC/openSUSE:Leap:15.2/.salt.new.26092/v2019.2.3.tar.gz differ: char 14, line 1
