Hello community, here is the log from the commit of package salt for openSUSE:Factory checked in at 2016-04-28 16:57:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/salt (Old) and /work/SRC/openSUSE:Factory/.salt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "salt" Changes: -------- --- /work/SRC/openSUSE:Factory/salt/salt.changes 2016-03-26 15:24:20.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.salt.new/salt.changes 2016-04-28 17:02:56.000000000 +0200 @@ -1,0 +2,130 @@ +Wed Apr 20 09:27:31 UTC 2016 - [email protected] + +- Prevent crash if pygit2 package requests recompilation. + Add: + * 0013-Prevent-crash-if-pygit2-package-is-requesting-re-com.patch +- Align OS grains from older SLES with the current one (bsc#975757) + Add: + * 0014-align-OS-grains-from-older-SLES-with-current-one-326.patch + +------------------------------------------------------------------- +Sat Apr 16 15:15:07 UTC 2016 - [email protected] + +- remove patches which produce duplicate functions: + Remove: + * 0004-implement-version_cmp-for-zypper.patch + * 0005-pylint-changes.patch + * 0006-Check-if-rpm-python-can-be-imported.patch +- remove patches which add and revert the same file + Remove: + * 0007-Initial-Zypper-Unit-Tests-and-bugfixes.patch + * 0009-Bugfix-on-SLE11-series-base-product-reported-as-addi.patch +- rename patches: + 0008-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch to + 0004-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch + 0010-Use-SHA256-hash-type-by-default.patch to + 0005-Use-SHA256-hash-type-by-default.patch + 0011-Update-to-2015.8.8.2.patch to + 0006-Update-to-2015.8.8.2.patch + 0012-Force-sort-the-RPM-output-to-ensure-latest-version-o.patch to + 0007-Force-sort-the-RPM-output-to-ensure-latest-version-o.patch + 0013-Cleaner-deprecation-process-with-decorators.patch to + 0008-Cleaner-deprecation-process-with-decorators.patch +- fix sorting by latest package + Add: + * 0009-fix-sorting-by-latest-version-when-called-with-an-at.patch +- Prevent metadata download when getting installed products + Add: + * 0010-Prevent-metadata-download-when-getting-installed-pro.patch +- Check if EOL is available in a particular product (bsc#975093) + Add: + * 0011-Check-if-EOL-is-available-in-a-particular-product-bs.patch +- Bugfix: salt-key crashes if tries to generate keys + to the directory w/o write access (bsc#969320) + Add: + * 0012-Bugfix-salt-key-crashes-if-tries-to-generate-keys-to.patch + +------------------------------------------------------------------- +Thu Apr 7 10:25:36 UTC 2016 - [email protected] + +- Deprecation process using decorators and re-implementation + of status.update function. + Add: + * 0013-Cleaner-deprecation-process-with-decorators.patch + +------------------------------------------------------------------- +Fri Apr 1 19:19:10 UTC 2016 - [email protected] + +- Reverted the fake 2015.8.8.2 patch, with the right one, +- this patch only contains: + - https://github.com/saltstack/salt/pull/32135 + - https://github.com/saltstack/salt/pull/32023 + - https://github.com/saltstack/salt/pull/32117 + +------------------------------------------------------------------- +Fri Apr 1 12:16:10 UTC 2016 - [email protected] + +- Ensure that in case of multi-packages installed on the system, + the latest is reported by pkg.info_installed (bsc#972490) + Add: + * 0012-Force-sort-the-RPM-output-to-ensure-latest-version-o.patch + +------------------------------------------------------------------- +Wed Mar 30 22:33:19 UTC 2016 - [email protected] + +- Update to the fake 2015.8.8.2 release + upstream released a bunch of fixes on top of 2015.8.8, without creating a new + tag and proper release. This commit includes all the changes between tag + v2015.8.8 and commit ID 596444e2b447b7378dbcdfeb9fc9610b90057745 which + introduces the fake 2015.8.8.2 release. + see https://docs.saltstack.com/en/latest/topics/releases/2015.8.8.html#salt-2015-8-8-2 + +------------------------------------------------------------------- +Thu Mar 24 17:34:03 UTC 2016 - [email protected] + +- Update to 2015.8.8 + see https://docs.saltstack.com/en/latest/topics/releases/2015.8.8.html + Patches renamed: + * 0004-implement-version_cmp-for-zypper.patch + * 0005-pylint-changes.patch + * 0006-Check-if-rpm-python-can-be-imported.patch + * 0007-Initial-Zypper-Unit-Tests-and-bugfixes.patch + * 0008-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch + * 0009-Bugfix-on-SLE11-series-base-product-reported-as-addi.patch + * 0010-Use-SHA256-hash-type-by-default.patch + Patches removed: + * 0004-Fix-pkg.latest-prevent-crash-on-multiple-package-ins.patch + * 0005-Fix-package-status-filtering-on-latest-version-and-i.patch + * 0006-add_key-reject_key-do-not-crash-w-Permission-denied-.patch + * 0007-Force-kill-websocket-s-child-processes-faster-than-d.patch + * 0008-Fix-types-in-the-output-data-and-return-just-a-list-.patch + * 0009-The-functions-in-the-state-module-that-return-a-retc.patch + * 0010-add-handling-for-OEM-products.patch + * 0011-improve-doc-for-list_pkgs.patch + * 0012-implement-version_cmp-for-zypper.patch + * 0013-pylint-changes.patch + * 0014-Check-if-rpm-python-can-be-imported.patch + * 0015-call-zypper-with-option-non-interactive-everywhere.patch + * 0016-write-a-zypper-command-builder-function.patch + * 0017-Fix-crash-with-scheduler-and-runners-31106.patch + * 0018-unify-behavior-of-refresh.patch + * 0019-add-refresh-option-to-more-functions.patch + * 0020-simplify-checking-the-refresh-paramater.patch + * 0021-do-not-change-kwargs-in-refresh-while-checking-a-val.patch + * 0022-fix-argument-handling-for-pkg.download.patch + * 0023-Initial-Zypper-Unit-Tests-and-bugfixes.patch + * 0024-proper-checking-if-zypper-exit-codes-and-handling-of.patch + * 0025-adapt-tests-to-new-zypper_check_result-output.patch + * 0026-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch + * 0027-make-suse-check-consistent-with-rh_service.patch + * 0028-fix-numerical-check-of-osrelease.patch + * 0029-Make-use-of-checksum-configurable-defaults-to-MD5-SH.patch + * 0030-Bugfix-on-SLE11-series-base-product-reported-as-addi.patch + * 0031-Only-use-LONGSIZE-in-rpm.info-if-available.-Otherwis.patch + * 0032-Add-error-check-when-retcode-is-0-but-stderr-is-pres.patch + * 0033-fixing-init-system-dectection-on-sles-11-refs-31617.patch + * 0034-Fix-git_pillar-race-condition.patch + * 0035-Fix-the-always-false-behavior-on-checking-state.patch + * 0036-Use-SHA256-hash-type-by-default.patch + +------------------------------------------------------------------- Old: ---- 0004-Fix-pkg.latest-prevent-crash-on-multiple-package-ins.patch 0005-Fix-package-status-filtering-on-latest-version-and-i.patch 0006-add_key-reject_key-do-not-crash-w-Permission-denied-.patch 0007-Force-kill-websocket-s-child-processes-faster-than-d.patch 0008-Fix-types-in-the-output-data-and-return-just-a-list-.patch 0009-The-functions-in-the-state-module-that-return-a-retc.patch 0010-add-handling-for-OEM-products.patch 0011-improve-doc-for-list_pkgs.patch 0012-implement-version_cmp-for-zypper.patch 0013-pylint-changes.patch 0014-Check-if-rpm-python-can-be-imported.patch 0015-call-zypper-with-option-non-interactive-everywhere.patch 0016-write-a-zypper-command-builder-function.patch 0017-Fix-crash-with-scheduler-and-runners-31106.patch 0018-unify-behavior-of-refresh.patch 0019-add-refresh-option-to-more-functions.patch 0020-simplify-checking-the-refresh-paramater.patch 0021-do-not-change-kwargs-in-refresh-while-checking-a-val.patch 0022-fix-argument-handling-for-pkg.download.patch 0023-Initial-Zypper-Unit-Tests-and-bugfixes.patch 0024-proper-checking-if-zypper-exit-codes-and-handling-of.patch 0025-adapt-tests-to-new-zypper_check_result-output.patch 0026-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch 0027-make-suse-check-consistent-with-rh_service.patch 0028-fix-numerical-check-of-osrelease.patch 0029-Make-use-of-checksum-configurable-defaults-to-MD5-SH.patch 0030-Bugfix-on-SLE11-series-base-product-reported-as-addi.patch 0031-Only-use-LONGSIZE-in-rpm.info-if-available.-Otherwis.patch 0032-Add-error-check-when-retcode-is-0-but-stderr-is-pres.patch 0033-fixing-init-system-dectection-on-sles-11-refs-31617.patch 0034-Fix-git_pillar-race-condition.patch 0035-Fix-the-always-false-behavior-on-checking-state.patch 0036-Use-SHA256-hash-type-by-default.patch salt-2015.8.7.tar.gz New: ---- 0004-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch 0005-Use-SHA256-hash-type-by-default.patch 0006-Update-to-2015.8.8.2.patch 0007-Force-sort-the-RPM-output-to-ensure-latest-version-o.patch 0008-Cleaner-deprecation-process-with-decorators.patch 0009-fix-sorting-by-latest-version-when-called-with-an-at.patch 0010-Prevent-metadata-download-when-getting-installed-pro.patch 0011-Check-if-EOL-is-available-in-a-particular-product-bs.patch 0012-Bugfix-salt-key-crashes-if-tries-to-generate-keys-to.patch 0013-Prevent-crash-if-pygit2-package-is-requesting-re-com.patch 0014-align-OS-grains-from-older-SLES-with-current-one-326.patch salt-2015.8.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ salt.spec ++++++ --- /var/tmp/diff_new_pack.REPLkg/_old 2016-04-28 17:02:58.000000000 +0200 +++ /var/tmp/diff_new_pack.REPLkg/_new 2016-04-28 17:02:58.000000000 +0200 @@ -36,7 +36,7 @@ %bcond_without docs Name: salt -Version: 2015.8.7 +Version: 2015.8.8 Release: 0 Summary: A parallel remote execution system License: Apache-2.0 @@ -53,64 +53,28 @@ Patch2: 0002-Run-salt-master-as-dedicated-salt-user.patch # PATCH-FIX-OPENSUSE https://github.com/saltstack/salt/pull/30424 Patch3: 0003-Check-if-byte-strings-are-properly-encoded-in-UTF-8.patch -# PATCH-FIX-OPENSUSE https://github.com/saltstack/salt/pull/30611 -Patch4: 0004-Fix-pkg.latest-prevent-crash-on-multiple-package-ins.patch -# PATCH-FIX-OPENSUSE https://github.com/saltstack/salt/pull/30663 -Patch5: 0005-Fix-package-status-filtering-on-latest-version-and-i.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/30998 -Patch6: 0006-add_key-reject_key-do-not-crash-w-Permission-denied-.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31125 -Patch7: 0007-Force-kill-websocket-s-child-processes-faster-than-d.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31134 -Patch8: 0008-Fix-types-in-the-output-data-and-return-just-a-list-.patch -# PATCH-FIX-UPSTREAM -Patch9: 0009-The-functions-in-the-state-module-that-return-a-retc.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31237 -Patch10: 0010-add-handling-for-OEM-products.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31234 -Patch11: 0011-improve-doc-for-list_pkgs.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31233 -Patch12: 0012-implement-version_cmp-for-zypper.patch -Patch13: 0013-pylint-changes.patch -Patch14: 0014-Check-if-rpm-python-can-be-imported.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31305 -Patch15: 0015-call-zypper-with-option-non-interactive-everywhere.patch -Patch16: 0016-write-a-zypper-command-builder-function.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31189 -Patch17: 0017-Fix-crash-with-scheduler-and-runners-31106.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31378 -Patch18: 0018-unify-behavior-of-refresh.patch -Patch19: 0019-add-refresh-option-to-more-functions.patch -Patch20: 0020-simplify-checking-the-refresh-paramater.patch -Patch21: 0021-do-not-change-kwargs-in-refresh-while-checking-a-val.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31429 -Patch22: 0022-fix-argument-handling-for-pkg.download.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31479 -# https://github.com/saltstack/salt/pull/31488 -Patch23: 0023-Initial-Zypper-Unit-Tests-and-bugfixes.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31508 -Patch24: 0024-proper-checking-if-zypper-exit-codes-and-handling-of.patch -Patch25: 0025-adapt-tests-to-new-zypper_check_result-output.patch # PATCH-FIX-OPENSUSE prevent rebuilds in OBS -Patch26: 0026-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31629 -Patch27: 0027-make-suse-check-consistent-with-rh_service.patch -Patch28: 0028-fix-numerical-check-of-osrelease.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31162 -Patch29: 0029-Make-use-of-checksum-configurable-defaults-to-MD5-SH.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31786 -Patch30: 0030-Bugfix-on-SLE11-series-base-product-reported-as-addi.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31445 -Patch31: 0031-Only-use-LONGSIZE-in-rpm.info-if-available.-Otherwis.patch -Patch32: 0032-Add-error-check-when-retcode-is-0-but-stderr-is-pres.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31793 -Patch33: 0033-fixing-init-system-dectection-on-sles-11-refs-31617.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31836 -Patch34: 0034-Fix-git_pillar-race-condition.patch -# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/31745 -Patch35: 0035-Fix-the-always-false-behavior-on-checking-state.patch +Patch4: 0004-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch # PATCH-FIX-OPENSUSE - Upstream default hash type is set to MD5, while we require SHA256 (bsc#955373) -Patch36: 0036-Use-SHA256-hash-type-by-default.patch +Patch5: 0005-Use-SHA256-hash-type-by-default.patch +# PATCH-FIX-UPSTREAM https://docs.saltstack.com/en/latest/topics/releases/2015.8.8.html#salt-2015-8-8-2 +Patch6: 0006-Update-to-2015.8.8.2.patch +# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/32243 +Patch7: 0007-Force-sort-the-RPM-output-to-ensure-latest-version-o.patch +# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/32068 +Patch8: 0008-Cleaner-deprecation-process-with-decorators.patch +# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/32323 +Patch9: 0009-fix-sorting-by-latest-version-when-called-with-an-at.patch +# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/32353 +Patch10: 0010-Prevent-metadata-download-when-getting-installed-pro.patch +# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/32505 +Patch11: 0011-Check-if-EOL-is-available-in-a-particular-product-bs.patch +# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/32436 +Patch12: 0012-Bugfix-salt-key-crashes-if-tries-to-generate-keys-to.patch +# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/32652 +Patch13: 0013-Prevent-crash-if-pygit2-package-is-requesting-re-com.patch +# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/32649 +Patch14: 0014-align-OS-grains-from-older-SLES-with-current-one-326.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: logrotate @@ -467,28 +431,6 @@ %patch12 -p1 %patch13 -p1 %patch14 -p1 -%patch15 -p1 -%patch16 -p1 -%patch17 -p1 -%patch18 -p1 -%patch19 -p1 -%patch20 -p1 -%patch21 -p1 -%patch22 -p1 -%patch23 -p1 -%patch24 -p1 -%patch25 -p1 -%patch26 -p1 -%patch27 -p1 -%patch28 -p1 -%patch29 -p1 -%patch30 -p1 -%patch31 -p1 -%patch32 -p1 -%patch33 -p1 -%patch34 -p1 -%patch35 -p1 -%patch36 -p1 %build python setup.py --salt-transport=both build ++++++ 0001-tserong-suse.com-We-don-t-have-python-systemd-so-not.patch ++++++ --- /var/tmp/diff_new_pack.REPLkg/_old 2016-04-28 17:02:58.000000000 +0200 +++ /var/tmp/diff_new_pack.REPLkg/_new 2016-04-28 17:02:58.000000000 +0200 @@ -1,7 +1,7 @@ -From f6534519ed6dcd443e9b5b8f7dc6dfe1fb508ab3 Mon Sep 17 00:00:00 2001 +From f9dbfde1c3e7782d78f6b0b2b6b564f61749941f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <[email protected]> Date: Wed, 20 Jan 2016 11:00:15 +0100 -Subject: [PATCH 01/22] [email protected] -- We don't have python-systemd, so +Subject: [PATCH 01/12] [email protected] -- We don't have python-systemd, so notify can't work --- ++++++ 0002-Run-salt-master-as-dedicated-salt-user.patch ++++++ --- /var/tmp/diff_new_pack.REPLkg/_old 2016-04-28 17:02:58.000000000 +0200 +++ /var/tmp/diff_new_pack.REPLkg/_new 2016-04-28 17:02:58.000000000 +0200 @@ -1,7 +1,7 @@ -From cd60b85c9e6bfd8ebf3505e5ff05e7fdec6211d6 Mon Sep 17 00:00:00 2001 +From af193a109fcae502c4cdd47507aea9f67d809b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <[email protected]> Date: Wed, 20 Jan 2016 11:01:06 +0100 -Subject: [PATCH 02/22] Run salt master as dedicated salt user +Subject: [PATCH 02/12] Run salt master as dedicated salt user --- conf/master | 3 ++- @@ -9,7 +9,7 @@ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/master b/conf/master -index 643b5f4..36657e8 100644 +index aae46ef..064828a 100644 --- a/conf/master +++ b/conf/master @@ -25,7 +25,8 @@ ++++++ 0003-Check-if-byte-strings-are-properly-encoded-in-UTF-8.patch ++++++ --- /var/tmp/diff_new_pack.REPLkg/_old 2016-04-28 17:02:58.000000000 +0200 +++ /var/tmp/diff_new_pack.REPLkg/_new 2016-04-28 17:02:58.000000000 +0200 @@ -1,7 +1,7 @@ -From 9dc25e7dfb08a7cd583215d0206f18b15a44ccb1 Mon Sep 17 00:00:00 2001 +From 6035aef0c80ae12a068bee7613c5b7f7f48aa9d3 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk <[email protected]> Date: Mon, 18 Jan 2016 16:28:48 +0100 -Subject: [PATCH 03/22] Check if byte strings are properly encoded in UTF-8 +Subject: [PATCH 03/12] Check if byte strings are properly encoded in UTF-8 Rename keywords arguments variable to a default name. --- @@ -9,10 +9,10 @@ 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py -index 0d62c68..dddcc2f 100644 +index fecb671..27b00d5 100644 --- a/salt/modules/zypper.py +++ b/salt/modules/zypper.py -@@ -112,9 +112,9 @@ def info_installed(*names, **kwargs): +@@ -164,9 +164,9 @@ def info_installed(*names, **kwargs): summary, description. :param errors: @@ -25,7 +25,7 @@ Valid attributes are: ignore, report -@@ -127,7 +127,8 @@ def info_installed(*names, **kwargs): +@@ -179,7 +179,8 @@ def info_installed(*names, **kwargs): salt '*' pkg.info_installed <package1> <package2> <package3> ... salt '*' pkg.info_installed <package1> attr=version,vendor salt '*' pkg.info_installed <package1> <package2> <package3> ... attr=version,vendor @@ -35,7 +35,7 @@ ''' ret = dict() for pkg_name, pkg_nfo in __salt__['lowpkg.info'](*names, **kwargs).items(): -@@ -138,7 +139,7 @@ def info_installed(*names, **kwargs): +@@ -190,7 +191,7 @@ def info_installed(*names, **kwargs): # Check, if string is encoded in a proper UTF-8 value_ = value.decode('UTF-8', 'ignore').encode('UTF-8', 'ignore') if value != value_: ++++++ 0026-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch -> 0004-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch ++++++ --- /work/SRC/openSUSE:Factory/salt/0026-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch 2016-03-07 13:28:38.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.salt.new/0004-do-not-generate-a-date-in-a-comment-to-prevent-rebui.patch 2016-04-28 17:02:56.000000000 +0200 @@ -1,7 +1,7 @@ -From 80784a70e90d16c5d8290fcc6bf8a0f4ec657ec0 Mon Sep 17 00:00:00 2001 +From a2ffa8e54f3cd8dba3c4b73cad086a6b93fb3a41 Mon Sep 17 00:00:00 2001 From: Michael Calmer <[email protected]> Date: Fri, 4 Mar 2016 09:51:22 +0100 -Subject: [PATCH 26/26] do not generate a date in a comment to prevent rebuilds +Subject: [PATCH 04/12] do not generate a date in a comment to prevent rebuilds (bsc#969407) --- @@ -9,10 +9,10 @@ 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py -index 8caa45e..dd76c64 100755 +index 742eae5..d2dd8f7 100755 --- a/setup.py +++ b/setup.py -@@ -600,8 +600,7 @@ class Clean(clean): +@@ -605,8 +605,7 @@ class Clean(clean): INSTALL_VERSION_TEMPLATE = '''\ ++++++ 0036-Use-SHA256-hash-type-by-default.patch -> 0005-Use-SHA256-hash-type-by-default.patch ++++++ --- /work/SRC/openSUSE:Factory/salt/0036-Use-SHA256-hash-type-by-default.patch 2016-03-26 15:24:19.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.salt.new/0005-Use-SHA256-hash-type-by-default.patch 2016-04-28 17:02:56.000000000 +0200 @@ -1,7 +1,7 @@ -From eea48a283a184a02223fc440fec54a47a5b47b62 Mon Sep 17 00:00:00 2001 +From d5fc00efc2f73018c4c6bf3bea03648dfd1340fc Mon Sep 17 00:00:00 2001 From: Bo Maryniuk <[email protected]> Date: Thu, 17 Mar 2016 12:30:23 +0100 -Subject: [PATCH 36/36] Use SHA256 hash type by default +Subject: [PATCH 05/12] Use SHA256 hash type by default --- conf/master | 2 +- @@ -10,7 +10,7 @@ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/master b/conf/master -index cf05ec4..5f6beaa 100644 +index 064828a..5e75b15 100644 --- a/conf/master +++ b/conf/master @@ -474,7 +474,7 @@ syndic_user: salt @@ -23,10 +23,10 @@ # The buffer size in the file server can be adjusted here: #file_buffer_size: 1048576 diff --git a/conf/minion b/conf/minion -index e17ec61..ba4111a 100644 +index b408942..32b0d0a 100644 --- a/conf/minion +++ b/conf/minion -@@ -447,7 +447,7 @@ +@@ -451,7 +451,7 @@ # # Warning: Prior to changing this value, the minion should be stopped and all # Salt caches should be cleared. @@ -36,7 +36,7 @@ # The Salt pillar is searched for locally if file_client is set to local. If # this is the case, and pillar data is defined, then the pillar_roots need to diff --git a/conf/proxy b/conf/proxy -index 0de6af8..77ecf3b 100644 +index e6ca631..e697357 100644 --- a/conf/proxy +++ b/conf/proxy @@ -427,7 +427,7 @@ @@ -49,5 +49,5 @@ # The Salt pillar is searched for locally if file_client is set to local. If # this is the case, and pillar data is defined, then the pillar_roots need to -- -2.7.3 +2.1.4 ++++++ 0006-Update-to-2015.8.8.2.patch ++++++ >From 00600229ac41ae618bf01e8af6e2c0183d924204 Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos <[email protected]> Date: Sat, 2 Apr 2016 12:29:04 +0200 Subject: [PATCH 06/12] Update to 2015.8.8.2 upstream released a bunch of fixes on top of 2015.8.8, without creating a new tag and proper release. This commit includes: - https://github.com/saltstack/salt/pull/32135 - https://github.com/saltstack/salt/pull/32023 - https://github.com/saltstack/salt/pull/32117 see https://docs.saltstack.com/en/latest/topics/releases/2015.8.8.html#salt-2015-8-8-2 --- salt/config.py | 63 ++++++++++++++++++++++++++++-------------------- salt/modules/win_dacl.py | 7 +++--- 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/salt/config.py b/salt/config.py index fe1f572..929e094 100644 --- a/salt/config.py +++ b/salt/config.py @@ -63,7 +63,7 @@ FLO_DIR = os.path.join( VALID_OPTS = { # The address of the salt master. May be specified as IP address or hostname - 'master': str, + 'master': (str, list), # The TCP/UDP port of the master to connect to in order to listen to publications 'master_port': int, @@ -541,7 +541,7 @@ VALID_OPTS = { 'file_recv': bool, 'file_recv_max_size': int, 'file_ignore_regex': list, - 'file_ignore_glob': bool, + 'file_ignore_glob': list, 'fileserver_backend': list, 'fileserver_followsymlinks': bool, 'fileserver_ignoresymlinks': bool, @@ -833,7 +833,7 @@ DEFAULT_MINION_OPTS = { 'file_recv': False, 'file_recv_max_size': 100, 'file_ignore_regex': [], - 'file_ignore_glob': None, + 'file_ignore_glob': [], 'fileserver_backend': ['roots'], 'fileserver_followsymlinks': True, 'fileserver_ignoresymlinks': False, @@ -1348,26 +1348,30 @@ def _validate_opts(opts): Check that all of the types of values passed into the config are of the right types ''' + def format_multi_opt(valid_type): + try: + num_types = len(valid_type) + except TypeError: + # Bare type name won't have a length, return the name of the type + # passed. + return valid_type.__name__ + else: + if num_types == 1: + return valid_type.__name__ + elif num_types > 1: + ret = ', '.join(x.__name__ for x in valid_type[:-1]) + ret += ' or ' + valid_type[-1].__name__ + errors = [] - err = ('Key {0} with value {1} has an invalid type of {2}, a {3} is ' + + err = ('Key \'{0}\' with value {1} has an invalid type of {2}, a {3} is ' 'required for this value') for key, val in six.iteritems(opts): if key in VALID_OPTS: - if isinstance(VALID_OPTS[key](), list): - if isinstance(val, VALID_OPTS[key]): - continue - else: - errors.append( - err.format(key, val, type(val).__name__, 'list') - ) - if isinstance(VALID_OPTS[key](), dict): - if isinstance(val, VALID_OPTS[key]): - continue - else: - errors.append( - err.format(key, val, type(val).__name__, 'dict') - ) - else: + if isinstance(val, VALID_OPTS[key]): + continue + + if hasattr(VALID_OPTS[key], '__call__'): try: VALID_OPTS[key](val) if isinstance(val, (list, dict)): @@ -1384,14 +1388,21 @@ def _validate_opts(opts): VALID_OPTS[key].__name__ ) ) - except ValueError: + except (TypeError, ValueError): errors.append( - err.format(key, val, type(val).__name__, VALID_OPTS[key]) - ) - except TypeError: - errors.append( - err.format(key, val, type(val).__name__, VALID_OPTS[key]) + err.format(key, + val, + type(val).__name__, + VALID_OPTS[key].__name__) ) + continue + + errors.append( + err.format(key, + val, + type(val).__name__, + format_multi_opt(VALID_OPTS[key].__name__)) + ) # RAET on Windows uses 'win32file.CreateMailslot()' for IPC. Due to this, # sock_dirs must start with '\\.\mailslot\' and not contain any colons. @@ -1404,7 +1415,7 @@ def _validate_opts(opts): '\\\\.\\mailslot\\' + opts['sock_dir'].replace(':', '')) for error in errors: - log.warning(error) + log.debug(error) if errors: return False return True diff --git a/salt/modules/win_dacl.py b/salt/modules/win_dacl.py index d57bb7b..d9ee27a 100644 --- a/salt/modules/win_dacl.py +++ b/salt/modules/win_dacl.py @@ -44,9 +44,10 @@ class daclConstants(object): # in ntsecuritycon has the extra bits 0x200 enabled. # Note that you when you set this permission what you'll generally get back is it # ORed with 0x200 (SI_NO_ACL_PROTECT), which is what ntsecuritycon incorrectly defines. - FILE_ALL_ACCESS = (ntsecuritycon.STANDARD_RIGHTS_REQUIRED | ntsecuritycon.SYNCHRONIZE | 0x1ff) def __init__(self): + self.FILE_ALL_ACCESS = (ntsecuritycon.STANDARD_RIGHTS_REQUIRED | ntsecuritycon.SYNCHRONIZE | 0x1ff) + self.hkeys_security = { 'HKEY_LOCAL_MACHINE': 'MACHINE', 'HKEY_USERS': 'USERS', @@ -88,7 +89,7 @@ class daclConstants(object): ntsecuritycon.DELETE, 'TEXT': 'modify'}, 'FULLCONTROL': { - 'BITS': daclConstants.FILE_ALL_ACCESS, + 'BITS': self.FILE_ALL_ACCESS, 'TEXT': 'full control'} } } @@ -368,7 +369,7 @@ def add_ace(path, objectType, user, permission, acetype, propagation): path: path to the object (i.e. c:\\temp\\file, HKEY_LOCAL_MACHINE\\SOFTWARE\\KEY, etc) user: user to add permission: permissions for the user - acetypes: either allow/deny for each user/permission (ALLOW, DENY) + acetype: either allow/deny for each user/permission (ALLOW, DENY) propagation: how the ACE applies to children for Registry Keys and Directories(KEY, KEY&SUBKEYS, SUBKEYS) CLI Example: -- 2.1.4 ++++++ 0007-Force-sort-the-RPM-output-to-ensure-latest-version-o.patch ++++++ >From e3a599712daafb88b6b77ebf6c7684fdd10ffedf Mon Sep 17 00:00:00 2001 From: Bo Maryniuk <[email protected]> Date: Wed, 30 Mar 2016 12:14:21 +0200 Subject: [PATCH 07/12] Force-sort the RPM output to ensure latest version of the multi-package on top of the list. - Remove version_cmp from the yumpkg and use just a lowpkg alias - Remove version_cmp from Zypper module and use just lowpkg alias - Merge yumpkg's and zypper's version_cmp for a common use - Sort installed pkgs data by version_cmp - Move "string to EVR" function to the utilities - Remove suse/redhat checks, refactor code. - Fix condition from returning None on 0 - Remove tests from the zypper_test that belongs to rpm_test - Add lowpkg tests for version comparison - Fix lint - Fix the documentation --- salt/modules/rpm.py | 60 +++++++++++++++++++++++++++++++++++++-- salt/modules/yumpkg.py | 28 ++---------------- salt/modules/zypper.py | 58 +------------------------------------ salt/utils/__init__.py | 35 +++++++++++++++++++++++ tests/unit/modules/rpm_test.py | 21 ++++++++++++++ tests/unit/modules/zypper_test.py | 22 -------------- 6 files changed, 117 insertions(+), 107 deletions(-) diff --git a/salt/modules/rpm.py b/salt/modules/rpm.py index 5d60dd2..6026f18 100644 --- a/salt/modules/rpm.py +++ b/salt/modules/rpm.py @@ -17,6 +17,19 @@ import salt.utils.pkg.rpm # pylint: disable=import-error,redefined-builtin from salt.ext.six.moves import shlex_quote as _cmd_quote from salt.ext.six.moves import zip + +try: + import rpm + HAS_RPM = True +except ImportError: + HAS_RPM = False + +try: + import rpmUtils.miscutils + HAS_RPMUTILS = True +except ImportError: + HAS_RPMUTILS = False + # pylint: enable=import-error,redefined-builtin from salt.exceptions import CommandExecutionError, SaltInvocationError @@ -491,7 +504,7 @@ def info(*packages, **attr): else: out = call['stdout'] - ret = dict() + _ret = list() for pkg_info in re.split(r"----*", out): pkg_info = pkg_info.strip() if not pkg_info: @@ -538,6 +551,49 @@ def info(*packages, **attr): if attr and 'description' in attr or not attr: pkg_data['description'] = os.linesep.join(descr) if pkg_name: - ret[pkg_name] = pkg_data + pkg_data['name'] = pkg_name + _ret.append(pkg_data) + + # Force-sort package data by version, + # pick only latest versions + # (in case multiple packages installed, e.g. kernel) + ret = dict() + for pkg_data in reversed(sorted(_ret, cmp=lambda a_vrs, b_vrs: version_cmp(a_vrs['version'], b_vrs['version']))): + pkg_name = pkg_data.pop('name') + if pkg_name not in ret: + ret[pkg_name] = pkg_data.copy() return ret + + +def version_cmp(ver1, ver2): + ''' + .. versionadded:: 2015.8.9 + + Do a cmp-style comparison on two packages. Return -1 if ver1 < ver2, 0 if + ver1 == ver2, and 1 if ver1 > ver2. Return None if there was a problem + making the comparison. + + CLI Example: + + .. code-block:: bash + + salt '*' pkg.version_cmp '0.2-001' '0.2.0.1-002' + ''' + try: + if HAS_RPM: + cmp_func = rpm.labelCompare + elif HAS_RPMUTILS: + cmp_func = rpmUtils.miscutils.compareEVR + else: + cmp_func = None + cmp_result = cmp_func is None and 2 or cmp_func(salt.utils.str_version_to_evr(ver1), + salt.utils.str_version_to_evr(ver2)) + if cmp_result not in (-1, 0, 1): + raise Exception("Comparison result '{0}' is invalid".format(cmp_result)) + + return cmp_result + except Exception as exc: + log.warning("Failed to compare version '{0}' to '{1}' using RPM: {2}".format(ver1, ver2, exc)) + + return salt.utils.version_cmp(ver1, ver2) diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 1bfc38d..1cde676 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -40,12 +40,6 @@ try: except ImportError: from salt.ext.six.moves import configparser HAS_YUM = False - -try: - import rpmUtils.miscutils - HAS_RPMUTILS = True -except ImportError: - HAS_RPMUTILS = False # pylint: enable=import-error,redefined-builtin # Import salt libs @@ -665,26 +659,8 @@ def version_cmp(pkg1, pkg2): salt '*' pkg.version_cmp '0.2-001' '0.2.0.1-002' ''' - if HAS_RPMUTILS: - try: - cmp_result = rpmUtils.miscutils.compareEVR( - rpmUtils.miscutils.stringToVersion(pkg1), - rpmUtils.miscutils.stringToVersion(pkg2) - ) - if cmp_result not in (-1, 0, 1): - raise Exception( - 'cmp result \'{0}\' is invalid'.format(cmp_result) - ) - return cmp_result - except Exception as exc: - log.warning( - 'Failed to compare version \'%s\' to \'%s\' using ' - 'rpmUtils: %s', pkg1, pkg2, exc - ) - # Fall back to distutils.version.LooseVersion (should only need to do - # this for RHEL5, or if an exception is raised when attempting to compare - # using rpmUtils) - return salt.utils.version_cmp(pkg1, pkg2) + + return __salt__['lowpkg.version_cmp'](pkg1, pkg2) def list_pkgs(versions_as_list=False, **kwargs): diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py index 27b00d5..63c473c 100644 --- a/salt/modules/zypper.py +++ b/salt/modules/zypper.py @@ -17,12 +17,6 @@ import os import salt.ext.six as six from salt.ext.six.moves import configparser from salt.ext.six.moves.urllib.parse import urlparse as _urlparse - -try: - import rpm - HAS_RPM = True -except ImportError: - HAS_RPM = False # pylint: enable=import-error,redefined-builtin,no-name-in-module from xml.dom import minidom as dom @@ -347,40 +341,6 @@ def version(*names, **kwargs): return __salt__['pkg_resource.version'](*names, **kwargs) or {} -def _string_to_evr(verstring): - ''' - Split the version string into epoch, version and release and - return this as tuple. - - epoch is always not empty. - version and release can be an empty string if such a component - could not be found in the version string. - - "2:1.0-1.2" => ('2', '1.0', '1.2) - "1.0" => ('0', '1.0', '') - "" => ('0', '', '') - ''' - if verstring in [None, '']: - return ('0', '', '') - idx_e = verstring.find(':') - if idx_e != -1: - try: - epoch = str(int(verstring[:idx_e])) - except ValueError: - # look, garbage in the epoch field, how fun, kill it - epoch = '0' # this is our fallback, deal - else: - epoch = '0' - idx_r = verstring.find('-') - if idx_r != -1: - version = verstring[idx_e + 1:idx_r] - release = verstring[idx_r + 1:] - else: - version = verstring[idx_e + 1:] - release = '' - return (epoch, version, release) - - def version_cmp(ver1, ver2): ''' .. versionadded:: 2015.5.4 @@ -395,23 +355,7 @@ def version_cmp(ver1, ver2): salt '*' pkg.version_cmp '0.2-001' '0.2.0.1-002' ''' - if HAS_RPM: - try: - cmp_result = rpm.labelCompare( - _string_to_evr(ver1), - _string_to_evr(ver2) - ) - if cmp_result not in (-1, 0, 1): - raise Exception( - 'cmp result \'{0}\' is invalid'.format(cmp_result) - ) - return cmp_result - except Exception as exc: - log.warning( - 'Failed to compare version \'{0}\' to \'{1}\' using ' - 'rpmUtils: {2}'.format(ver1, ver2, exc) - ) - return salt.utils.version_cmp(ver1, ver2) + return __salt__['lowpkg.version_cmp'](ver1, ver2) def list_pkgs(versions_as_list=False, **kwargs): diff --git a/salt/utils/__init__.py b/salt/utils/__init__.py index f83a677..8956a15 100644 --- a/salt/utils/__init__.py +++ b/salt/utils/__init__.py @@ -2881,3 +2881,38 @@ def split_input(val): return [x.strip() for x in val.split(',')] except AttributeError: return [x.strip() for x in str(val).split(',')] + + +def str_version_to_evr(verstring): + ''' + Split the package version string into epoch, version and release. + Return this as tuple. + + The epoch is always not empty. The version and the release can be an empty + string if such a component could not be found in the version string. + + "2:1.0-1.2" => ('2', '1.0', '1.2) + "1.0" => ('0', '1.0', '') + "" => ('0', '', '') + ''' + if verstring in [None, '']: + return '0', '', '' + + idx_e = verstring.find(':') + if idx_e != -1: + try: + epoch = str(int(verstring[:idx_e])) + except ValueError: + # look, garbage in the epoch field, how fun, kill it + epoch = '0' # this is our fallback, deal + else: + epoch = '0' + idx_r = verstring.find('-') + if idx_r != -1: + version = verstring[idx_e + 1:idx_r] + release = verstring[idx_r + 1:] + else: + version = verstring[idx_e + 1:] + release = '' + + return epoch, version, release diff --git a/tests/unit/modules/rpm_test.py b/tests/unit/modules/rpm_test.py index 8bfce9b..f180736 100644 --- a/tests/unit/modules/rpm_test.py +++ b/tests/unit/modules/rpm_test.py @@ -95,6 +95,27 @@ class RpmTestCase(TestCase): self.assertDictEqual(rpm.owner('/usr/bin/python', '/usr/bin/vim'), ret) + @patch('salt.modules.rpm.HAS_RPM', True) + def test_version_cmp_rpm(self): + ''' + Test package version is called RPM version if RPM-Python is installed + + :return: + ''' + rpm.rpm = MagicMock(return_value=MagicMock) + with patch('salt.modules.rpm.rpm.labelCompare', MagicMock(return_value=0)): + self.assertEqual(0, rpm.version_cmp('1', '2')) # mock returns 0, which means RPM was called + + @patch('salt.modules.rpm.HAS_RPM', False) + def test_version_cmp_fallback(self): + ''' + Test package version is called RPM version if RPM-Python is installed + + :return: + ''' + rpm.rpm = MagicMock(return_value=MagicMock) + with patch('salt.modules.rpm.rpm.labelCompare', MagicMock(return_value=0)): + self.assertEqual(-1, rpm.version_cmp('1', '2')) # mock returns -1, a python implementation was called if __name__ == '__main__': from integration import run_tests diff --git a/tests/unit/modules/zypper_test.py b/tests/unit/modules/zypper_test.py index 5c4eb67..67cf52a 100644 --- a/tests/unit/modules/zypper_test.py +++ b/tests/unit/modules/zypper_test.py @@ -301,28 +301,6 @@ class ZypperTestCase(TestCase): self.assertFalse(zypper.upgrade_available(pkg_name)) self.assertTrue(zypper.upgrade_available('vim')) - @patch('salt.modules.zypper.HAS_RPM', True) - def test_version_cmp_rpm(self): - ''' - Test package version is called RPM version if RPM-Python is installed - - :return: - ''' - with patch('salt.modules.zypper.rpm', MagicMock(return_value=MagicMock)): - with patch('salt.modules.zypper.rpm.labelCompare', MagicMock(return_value=0)): - self.assertEqual(0, zypper.version_cmp('1', '2')) # mock returns 0, which means RPM was called - - @patch('salt.modules.zypper.HAS_RPM', False) - def test_version_cmp_fallback(self): - ''' - Test package version is called RPM version if RPM-Python is installed - - :return: - ''' - with patch('salt.modules.zypper.rpm', MagicMock(return_value=MagicMock)): - with patch('salt.modules.zypper.rpm.labelCompare', MagicMock(return_value=0)): - self.assertEqual(-1, zypper.version_cmp('1', '2')) # mock returns -1, a python implementation was called - def test_list_pkgs(self): ''' Test packages listing. -- 2.1.4 ++++++ 0008-Cleaner-deprecation-process-with-decorators.patch ++++++ ++++ 922 lines (skipped) ++++++ 0009-fix-sorting-by-latest-version-when-called-with-an-at.patch ++++++ >From cb588505919b6c74ed824d26a184eec0f47a585b Mon Sep 17 00:00:00 2001 From: Michael Calmer <[email protected]> Date: Mon, 4 Apr 2016 09:49:31 +0200 Subject: [PATCH 09/12] fix sorting by latest version when called with an attribute --- salt/modules/rpm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/salt/modules/rpm.py b/salt/modules/rpm.py index 6026f18..1469368 100644 --- a/salt/modules/rpm.py +++ b/salt/modules/rpm.py @@ -471,6 +471,7 @@ def info(*packages, **attr): "url": "%|URL?{url: %{URL}\\n}|", "summary": "summary: %{SUMMARY}\\n", "description": "description:\\n%{DESCRIPTION}\\n", + "edition": "edition: %|EPOCH?{%{EPOCH}:}|%{VERSION}-%{RELEASE}\\n", } attr = attr.get('attr', None) and attr['attr'].split(",") or None @@ -484,6 +485,9 @@ def info(*packages, **attr): if 'name' not in attr: attr.append('name') query.append(attr_map['name']) + if 'edition' not in attr: + attr.append('edition') + query.append(attr_map['edition']) else: for attr_k, attr_v in attr_map.iteritems(): if attr_k != 'description': @@ -558,10 +562,11 @@ def info(*packages, **attr): # pick only latest versions # (in case multiple packages installed, e.g. kernel) ret = dict() - for pkg_data in reversed(sorted(_ret, cmp=lambda a_vrs, b_vrs: version_cmp(a_vrs['version'], b_vrs['version']))): + for pkg_data in reversed(sorted(_ret, cmp=lambda a_vrs, b_vrs: version_cmp(a_vrs['edition'], b_vrs['edition']))): pkg_name = pkg_data.pop('name') if pkg_name not in ret: ret[pkg_name] = pkg_data.copy() + del ret[pkg_name]['edition'] return ret -- 2.1.4 ++++++ 0010-Prevent-metadata-download-when-getting-installed-pro.patch ++++++ >From 336929a4cadca55b00dbf1cd33eb35d19f420c73 Mon Sep 17 00:00:00 2001 From: Michael Calmer <[email protected]> Date: Tue, 5 Apr 2016 12:06:29 +0200 Subject: [PATCH 10/12] Prevent metadata download when getting installed products --- salt/modules/zypper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py index 63c473c..9702f42 100644 --- a/salt/modules/zypper.py +++ b/salt/modules/zypper.py @@ -1309,7 +1309,10 @@ def list_products(all=False, refresh=False): ret = list() OEM_PATH = "/var/lib/suseRegister/OEM" - cmd = _zypper('-x', 'products') + cmd = _zypper() + if not all: + cmd.append('--disable-repos') + cmd.extend(['-x', 'products']) if not all: cmd.append('-i') -- 2.1.4 ++++++ 0011-Check-if-EOL-is-available-in-a-particular-product-bs.patch ++++++ >From aae1c09957eab3c89a6c8f78a579cdf9dcfbe188 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk <[email protected]> Date: Tue, 12 Apr 2016 13:52:35 +0200 Subject: [PATCH 11/12] Check if EOL is available in a particular product (bsc#975093) Update SLE11 SP3 data Update SLE12 SP1 data Adjust test values according to the testing data --- salt/modules/zypper.py | 13 +++++++-- .../unit/modules/zypp/zypper-products-sle11sp3.xml | 10 +++++++ .../unit/modules/zypp/zypper-products-sle12sp1.xml | 8 ++++++ tests/unit/modules/zypper_test.py | 32 ++++++++++++---------- 4 files changed, 45 insertions(+), 18 deletions(-) diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py index 9702f42..4ce5853 100644 --- a/salt/modules/zypper.py +++ b/salt/modules/zypper.py @@ -1318,12 +1318,19 @@ def list_products(all=False, refresh=False): call = __salt__['cmd.run_all'](cmd, output_loglevel='trace') doc = dom.parseString(_zypper_check_result(call, xml=True)) - for prd in doc.getElementsByTagName('product-list')[0].getElementsByTagName('product'): + product_list = doc.getElementsByTagName('product-list') + if not product_list: + return ret # No products found + + for prd in product_list[0].getElementsByTagName('product'): p_nfo = dict() for k_p_nfo, v_p_nfo in prd.attributes.items(): p_nfo[k_p_nfo] = k_p_nfo not in ['isbase', 'installed'] and v_p_nfo or v_p_nfo in ['true', '1'] - p_nfo['eol'] = prd.getElementsByTagName('endoflife')[0].getAttribute('text') - p_nfo['eol_t'] = int(prd.getElementsByTagName('endoflife')[0].getAttribute('time_t')) + + eol = prd.getElementsByTagName('endoflife') + if eol: + p_nfo['eol'] = eol[0].getAttribute('text') + p_nfo['eol_t'] = int(eol[0].getAttribute('time_t') or 0) p_nfo['description'] = " ".join( [line.strip() for line in _get_first_aggregate_text( prd.getElementsByTagName('description') diff --git a/tests/unit/modules/zypp/zypper-products-sle11sp3.xml b/tests/unit/modules/zypp/zypper-products-sle11sp3.xml index 89a85e3..99444fe 100644 --- a/tests/unit/modules/zypp/zypper-products-sle11sp3.xml +++ b/tests/unit/modules/zypp/zypper-products-sle11sp3.xml @@ -31,7 +31,17 @@ offers common management tools and technology certifications across the platform, and each product is enterprise-class.</description></product> +<product name="SUSE_SLES" version="11.3" release="1.201" epoch="0" arch="x86_64" productline="" registerrelease="" vendor="SUSE LINUX Products GmbH, Nuernberg, Germany" summary="SUSE Linux Enterprise Server 11 SP3 No EOL" shortname="" flavor="" isbase="0" repo="nu_novell_com:SLES11-SP3-Updates" installed="0">0x7ffdb538e948<description>SUSE Linux Enterprise offers a comprehensive + suite of products built on a single code base. + The platform addresses business needs from + the smallest thin-client devices to the world’s + most powerful high-performance computing + and mainframe servers. SUSE Linux Enterprise + offers common management tools and technology + certifications across the platform, and + each product is enterprise-class.</description></product> <product name="SUSE-Manager-Server" version="2.1" release="1.2" epoch="0" arch="x86_64" productline="" registerrelease="" vendor="SUSE LINUX Products GmbH, Nuernberg, Germany" summary="SUSE Manager Server" shortname="" flavor="cd" isbase="0" repo="nu_novell_com:SUSE-Manager-Server-2.1-Pool" installed="0"><endoflife time_t="0" text="1970-01-01T01:00:00+0100"/>0x7ffdb538e948<description>SUSE Manager Server appliance</description></product> <product name="SUSE-Manager-Server" version="2.1" release="1.2" epoch="0" arch="x86_64" productline="manager" registerrelease="" vendor="SUSE LINUX Products GmbH, Nuernberg, Germany" summary="SUSE Manager Server" shortname="" flavor="cd" isbase="1" repo="@System" installed="1"><endoflife time_t="0" text="1970-01-01T01:00:00+0100"/>0x7ffdb538e948<description>SUSE Manager Server appliance</description></product> +<product name="SUSE-Manager-Server-Broken-EOL" version="2.1" release="1.2" epoch="0" arch="x86_64" productline="manager" registerrelease="" vendor="SUSE LINUX Products GmbH, Nuernberg, Germany" summary="SUSE Manager Server" shortname="" flavor="cd" isbase="1" repo="@System" installed="1"><endoflife wrong="attribute"/>0x7ffdb538e948<description>SUSE Manager Server appliance</description></product> </product-list> </stream> diff --git a/tests/unit/modules/zypp/zypper-products-sle12sp1.xml b/tests/unit/modules/zypp/zypper-products-sle12sp1.xml index 1a50363..a086058 100644 --- a/tests/unit/modules/zypp/zypper-products-sle12sp1.xml +++ b/tests/unit/modules/zypp/zypper-products-sle12sp1.xml @@ -24,6 +24,14 @@ provisioning.</description></product> SUSE Manager Tools provide packages required to connect to a SUSE Manager Server. <p></description></product> +<product name="sle-manager-tools-beta-no-eol" version="12" release="0" epoch="0" arch="x86_64" vendor="obs://build.suse.de/Devel:Galaxy:Manager:Head" summary="SUSE Manager Tools" repo="SUSE-Manager-Head" productline="" registerrelease="" shortname="Manager-Tools" flavor="POOL" isbase="false" installed="false"><registerflavor>extension</registerflavor><description><p> + SUSE Manager Tools provide packages required to connect to a + SUSE Manager Server. + <p></description></product> +<product name="sle-manager-tools-beta-broken-eol" version="12" release="0" epoch="0" arch="x86_64" vendor="obs://build.suse.de/Devel:Galaxy:Manager:Head" summary="SUSE Manager Tools" repo="SUSE-Manager-Head" productline="" registerrelease="" shortname="Manager-Tools" flavor="POOL" isbase="false" installed="false"><endoflife wrong="attribute"/><registerflavor>extension</registerflavor><description><p> + SUSE Manager Tools provide packages required to connect to a + SUSE Manager Server. + <p></description></product> <product name="SLES" version="12.1" release="0" epoch="0" arch="x86_64" vendor="SUSE" summary="SUSE Linux Enterprise Server 12 SP1" repo="@System" productline="sles" registerrelease="" shortname="SLES12-SP1" flavor="DVD" isbase="true" installed="true"><endoflife time_t="1730332800" text="2024-10-31T01:00:00+01"/><registerflavor/><description>SUSE Linux Enterprise offers a comprehensive suite of products built on a single code base. The platform addresses business needs from diff --git a/tests/unit/modules/zypper_test.py b/tests/unit/modules/zypper_test.py index 67cf52a..97e42ef 100644 --- a/tests/unit/modules/zypper_test.py +++ b/tests/unit/modules/zypper_test.py @@ -153,24 +153,26 @@ class ZypperTestCase(TestCase): for filename, test_data in { 'zypper-products-sle12sp1.xml': { 'name': ['SLES', 'SLES', 'SUSE-Manager-Proxy', - 'SUSE-Manager-Server', 'sle-manager-tools-beta'], + 'SUSE-Manager-Server', 'sle-manager-tools-beta', + 'sle-manager-tools-beta-broken-eol', 'sle-manager-tools-beta-no-eol'], 'vendor': 'SUSE LLC <https://www.suse.com/>', - 'release': ['0', '0', '0', '0', '0'], - 'productline': [False, False, False, False, 'sles'], - 'eol_t': [1509408000, 1522454400, 1522454400, 1730332800, 1730332800], - 'isbase': [False, False, False, False, True], - 'installed': [False, False, False, False, True], + 'release': ['0', '0', '0', '0', '0', '0', '0'], + 'productline': [False, False, False, False, False, False, 'sles'], + 'eol_t': [None, 0, 1509408000, 1522454400, 1522454400, 1730332800, 1730332800], + 'isbase': [False, False, False, False, False, False, True], + 'installed': [False, False, False, False, False, False, True], }, 'zypper-products-sle11sp3.xml': { - 'name': ['SUSE-Manager-Server', 'SUSE-Manager-Server', - 'SUSE_SLES', 'SUSE_SLES', 'SUSE_SLES-SP4-migration'], + 'name': ['SUSE-Manager-Server', 'SUSE-Manager-Server', 'SUSE-Manager-Server-Broken-EOL', + 'SUSE_SLES', 'SUSE_SLES', 'SUSE_SLES', 'SUSE_SLES-SP4-migration'], 'vendor': 'SUSE LINUX Products GmbH, Nuernberg, Germany', - 'release': ['1.138', '1.2', '1.2', '1.201', '1.4'], - 'productline': [False, False, False, False, 'manager'], - 'eol_t': [0, 0, 0, 0, 0], - 'isbase': [False, False, False, False, True], - 'installed': [False, False, False, False, True], + 'release': ['1.138', '1.2', '1.2', '1.2', '1.201', '1.201', '1.4'], + 'productline': [False, False, False, False, False, 'manager', 'manager'], + 'eol_t': [None, 0, 0, 0, 0, 0, 0], + 'isbase': [False, False, False, False, False, True, True], + 'installed': [False, False, False, False, False, True, True], }}.items(): + ref_out = { 'retcode': 0, 'stdout': get_test_data(filename) @@ -178,10 +180,10 @@ class ZypperTestCase(TestCase): with patch.dict(zypper.__salt__, {'cmd.run_all': MagicMock(return_value=ref_out)}): products = zypper.list_products() - self.assertEqual(len(products), 5) + self.assertEqual(len(products), 7) self.assertIn(test_data['vendor'], [product['vendor'] for product in products]) for kwd in ['name', 'isbase', 'installed', 'release', 'productline', 'eol_t']: - self.assertEqual(test_data[kwd], sorted([prod[kwd] for prod in products])) + self.assertEqual(test_data[kwd], sorted([prod.get(kwd) for prod in products])) def test_refresh_db(self): ''' -- 2.1.4 ++++++ 0012-Bugfix-salt-key-crashes-if-tries-to-generate-keys-to.patch ++++++ >From 5e99ee2bec1139b1944284975454c716d477f3e0 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk <[email protected]> Date: Wed, 13 Apr 2016 16:15:37 +0200 Subject: [PATCH 12/12] Bugfix: salt-key crashes if tries to generate keys to the directory w/o write access (#32436) * Raise an exception if keys are tried to be written to the directory that has no write access permissions * Show an reasonable error message instead of a traceback crash. * Fix the unit tests --- salt/crypt.py | 6 ++++++ salt/scripts.py | 2 ++ tests/unit/crypt_test.py | 1 + 3 files changed, 9 insertions(+) diff --git a/salt/crypt.py b/salt/crypt.py index 573a3c1..e5f3317 100644 --- a/salt/crypt.py +++ b/salt/crypt.py @@ -15,6 +15,7 @@ import logging import traceback import binascii import weakref +import getpass from salt.ext.six.moves import zip # pylint: disable=import-error,redefined-builtin # Import third party libs @@ -94,6 +95,11 @@ def gen_keys(keydir, keyname, keysize, user=None): # Between first checking and the generation another process has made # a key! Use the winner's key return priv + + # Do not try writing anything, if directory has no permissions. + if not os.access(keydir, os.W_OK): + raise IOError('Write access denied to "{0}" for user "{1}".'.format(os.path.abspath(keydir), getpass.getuser())) + cumask = os.umask(191) with salt.utils.fopen(priv, 'wb+') as f: f.write(gen.exportKey('PEM')) diff --git a/salt/scripts.py b/salt/scripts.py index 7da79bf..38b100d 100644 --- a/salt/scripts.py +++ b/salt/scripts.py @@ -297,6 +297,8 @@ def salt_key(): SystemExit('\nExiting gracefully on Ctrl-c'), err, hardcrash, trace=trace) + except Exception as err: + sys.stderr.write("Error: {0}\n".format(err.message)) def salt_cp(): diff --git a/tests/unit/crypt_test.py b/tests/unit/crypt_test.py index 3ff3b09..f548820 100644 --- a/tests/unit/crypt_test.py +++ b/tests/unit/crypt_test.py @@ -86,6 +86,7 @@ class CryptTestCase(TestCase): @patch('os.umask', MagicMock()) @patch('os.chmod', MagicMock()) @patch('os.chown', MagicMock()) + @patch('os.access', MagicMock(return_value=True)) def test_gen_keys(self): with patch('salt.utils.fopen', mock_open()): open_priv_wb = call('/keydir/keyname.pem', 'wb+') -- 2.1.4 ++++++ 0013-Prevent-crash-if-pygit2-package-is-requesting-re-com.patch ++++++ >From f187ee058eb221eb5a34d51ca5db53bb8eeea5e1 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk <[email protected]> Date: Mon, 18 Apr 2016 16:25:05 +0200 Subject: [PATCH 13/14] Prevent crash if pygit2 package is requesting re-compilation * Prevent crash if pygit2 package is requesting re-compilation of the entire library on production systems (no *devel packages) * Fix PEP8: move imports to the top of the file * Move logger up * Add log error message in case if exception is not an ImportError --- salt/utils/gitfs.py | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/salt/utils/gitfs.py b/salt/utils/gitfs.py index 164c92e..5452c28 100644 --- a/salt/utils/gitfs.py +++ b/salt/utils/gitfs.py @@ -19,6 +19,18 @@ import subprocess import time from datetime import datetime +# Import salt libs +import salt.utils +import salt.utils.itertools +import salt.utils.url +import salt.fileserver +from salt.utils.process import os_is_running as pid_exists +from salt.exceptions import FileserverConfigError, GitLockError +from salt.utils.event import tagify + +# Import third party libs +import salt.ext.six as six + VALID_PROVIDERS = ('gitpython', 'pygit2', 'dulwich') # Optional per-remote params that can only be used on a per-remote basis, and # thus do not have defaults in salt/config.py. @@ -54,16 +66,8 @@ _INVALID_REPO = ( 'master to continue to use this {2} remote.' ) -# Import salt libs -import salt.utils -import salt.utils.itertools -import salt.utils.url -import salt.fileserver -from salt.exceptions import FileserverConfigError, GitLockError -from salt.utils.event import tagify +log = logging.getLogger(__name__) -# Import third party libs -import salt.ext.six as six # pylint: disable=import-error try: import git @@ -79,8 +83,13 @@ try: GitError = pygit2.errors.GitError except AttributeError: GitError = Exception -except ImportError: - HAS_PYGIT2 = False +except Exception as err: # cffi VerificationError also may happen + HAS_PYGIT2 = False # and pygit2 requrests re-compilation + # on a production system (!), + # but cffi might be absent as well! + # Therefore just a generic Exception class. + if not isinstance(err, ImportError): + log.error('Import pygit2 failed: {0}'.format(err)) try: import dulwich.errors @@ -93,8 +102,6 @@ except ImportError: HAS_DULWICH = False # pylint: enable=import-error -log = logging.getLogger(__name__) - # Minimum versions for backend providers GITPYTHON_MINVER = '0.3' PYGIT2_MINVER = '0.20.3' -- 2.8.1 ++++++ 0014-align-OS-grains-from-older-SLES-with-current-one-326.patch ++++++ >From 0961f5bd3e3b7aa3ebd75fe064044d078df62724 Mon Sep 17 00:00:00 2001 From: Michael Calmer <[email protected]> Date: Mon, 18 Apr 2016 16:31:58 +0200 Subject: [PATCH 14/14] align OS grains from older SLES with current one (#32649) --- salt/grains/core.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/salt/grains/core.py b/salt/grains/core.py index eb62b97..d5dbef8 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -1184,14 +1184,19 @@ def os_data(): for line in fhr: if 'enterprise' in line.lower(): grains['lsb_distrib_id'] = 'SLES' + grains['lsb_distrib_codename'] = re.sub(r'\(.+\)', '', line).strip() elif 'version' in line.lower(): version = re.sub(r'[^0-9]', '', line) elif 'patchlevel' in line.lower(): patch = re.sub(r'[^0-9]', '', line) grains['lsb_distrib_release'] = version if patch: - grains['lsb_distrib_release'] += ' SP' + patch - grains['lsb_distrib_codename'] = 'n.a' + grains['lsb_distrib_release'] += '.' + patch + patchstr = 'SP' + patch + if grains['lsb_distrib_codename'] and patchstr not in grains['lsb_distrib_codename']: + grains['lsb_distrib_codename'] += ' ' + patchstr + if not grains['lsb_distrib_codename']: + grains['lsb_distrib_codename'] = 'n.a' elif os.path.isfile('/etc/altlinux-release'): # ALT Linux grains['lsb_distrib_id'] = 'altlinux' -- 2.8.1 ++++++ salt-2015.8.7.tar.gz -> salt-2015.8.8.tar.gz ++++++ /work/SRC/openSUSE:Factory/salt/salt-2015.8.7.tar.gz /work/SRC/openSUSE:Factory/.salt.new/salt-2015.8.8.tar.gz differ: char 5, line 1
