osc copypac from project:systemsmanagement:saltstack package:salt revision:70

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:saltstack/salt?expand=0&rev=75
This commit is contained in:
Duncan Mac-Vicar 2016-06-24 12:36:42 +00:00 committed by Git OBS Bridge
parent 096090d289
commit 2e705c3b3d
18 changed files with 82 additions and 411 deletions

View File

@ -1,7 +1,7 @@
From 3f8257601cb1224221e10e712c0377254714f6fc Mon Sep 17 00:00:00 2001
From f9dbfde1c3e7782d78f6b0b2b6b564f61749941f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
Date: Wed, 20 Jan 2016 11:00:15 +0100
Subject: [PATCH 01/13] tserong@suse.com -- We don't have python-systemd, so
Subject: [PATCH 01/12] tserong@suse.com -- We don't have python-systemd, so
notify can't work
---
@ -9,7 +9,7 @@ Subject: [PATCH 01/13] tserong@suse.com -- We don't have python-systemd, so
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pkg/salt-master.service b/pkg/salt-master.service
index 0eadf88a3837..2b0f32623571 100644
index 0eadf88..2b0f326 100644
--- a/pkg/salt-master.service
+++ b/pkg/salt-master.service
@@ -4,8 +4,7 @@ After=network.target
@ -23,5 +23,5 @@ index 0eadf88a3837..2b0f32623571 100644
KillMode=process
--
2.8.3
2.1.4

View File

@ -1,7 +1,7 @@
From e86b0bf279c7faea457dfb8152fe9f5c829e42be Mon Sep 17 00:00:00 2001
From af193a109fcae502c4cdd47507aea9f67d809b4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
Date: Wed, 20 Jan 2016 11:01:06 +0100
Subject: [PATCH 02/13] 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 @@ Subject: [PATCH 02/13] Run salt master as dedicated salt user
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/conf/master b/conf/master
index 1bbeb50c51b4..54d5f8f3ca75 100644
index aae46ef..064828a 100644
--- a/conf/master
+++ b/conf/master
@@ -25,7 +25,8 @@
@ -23,7 +23,7 @@ index 1bbeb50c51b4..54d5f8f3ca75 100644
# The port used by the communication interface. The ret (return) port is the
# interface used for the file server, authentication, job returns, etc.
diff --git a/pkg/salt-common.logrotate b/pkg/salt-common.logrotate
index 3cd002308e83..8d970c0a64d0 100644
index 3cd0023..8d970c0 100644
--- a/pkg/salt-common.logrotate
+++ b/pkg/salt-common.logrotate
@@ -1,4 +1,5 @@
@ -49,5 +49,5 @@ index 3cd002308e83..8d970c0a64d0 100644
missingok
rotate 7
--
2.8.3
2.1.4

View File

@ -1,7 +1,7 @@
From 6ac3c2757bee8757e4a1e82c6472001584107bef Mon Sep 17 00:00:00 2001
From 6035aef0c80ae12a068bee7613c5b7f7f48aa9d3 Mon Sep 17 00:00:00 2001
From: Bo Maryniuk <bo@suse.de>
Date: Mon, 18 Jan 2016 16:28:48 +0100
Subject: [PATCH 03/13] 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 @@ Rename keywords arguments variable to a default name.
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index 9276ddfa61d2..13afd5afff9e 100644
index fecb671..27b00d5 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -329,9 +329,9 @@ def info_installed(*names, **kwargs):
@@ -164,9 +164,9 @@ def info_installed(*names, **kwargs):
summary, description.
:param errors:
@ -25,7 +25,7 @@ index 9276ddfa61d2..13afd5afff9e 100644
Valid attributes are:
ignore, report
@@ -344,7 +344,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 @@ index 9276ddfa61d2..13afd5afff9e 100644
'''
ret = dict()
for pkg_name, pkg_nfo in __salt__['lowpkg.info'](*names, **kwargs).items():
@@ -355,7 +356,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_:
@ -45,5 +45,5 @@ index 9276ddfa61d2..13afd5afff9e 100644
if key == 'source_rpm':
t_nfo['source'] = value
--
2.8.3
2.1.4

View File

@ -1,7 +1,7 @@
From a831380a6d7f323c9824d26d6f6e5966b10cbc6e Mon Sep 17 00:00:00 2001
From a2ffa8e54f3cd8dba3c4b73cad086a6b93fb3a41 Mon Sep 17 00:00:00 2001
From: Michael Calmer <mc@suse.de>
Date: Fri, 4 Mar 2016 09:51:22 +0100
Subject: [PATCH 04/13] 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 @@ Subject: [PATCH 04/13] do not generate a date in a comment to prevent rebuilds
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/setup.py b/setup.py
index c84c19824a6f..819ec2b875d1 100755
index 742eae5..d2dd8f7 100755
--- a/setup.py
+++ b/setup.py
@@ -618,8 +618,7 @@ class Clean(clean):
@@ -605,8 +605,7 @@ class Clean(clean):
INSTALL_VERSION_TEMPLATE = '''\
@ -23,5 +23,5 @@ index c84c19824a6f..819ec2b875d1 100755
from salt.version import SaltStackVersion
--
2.8.3
2.1.4

View File

@ -1,7 +1,7 @@
From 31010aabce9bb75d3aaabe396c3aadf558e3fee8 Mon Sep 17 00:00:00 2001
From d5fc00efc2f73018c4c6bf3bea03648dfd1340fc Mon Sep 17 00:00:00 2001
From: Bo Maryniuk <bo@suse.de>
Date: Thu, 17 Mar 2016 12:30:23 +0100
Subject: [PATCH 05/13] Use SHA256 hash type by default
Subject: [PATCH 05/12] Use SHA256 hash type by default
---
conf/master | 2 +-
@ -10,10 +10,10 @@ Subject: [PATCH 05/13] Use SHA256 hash type by default
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/conf/master b/conf/master
index 54d5f8f3ca75..b0ddf5043187 100644
index 064828a..5e75b15 100644
--- a/conf/master
+++ b/conf/master
@@ -491,7 +491,7 @@ syndic_user: salt
@@ -474,7 +474,7 @@ syndic_user: salt
#
# Prior to changing this value, the master should be stopped and all Salt
# caches should be cleared.
@ -23,10 +23,10 @@ index 54d5f8f3ca75..b0ddf5043187 100644
# The buffer size in the file server can be adjusted here:
#file_buffer_size: 1048576
diff --git a/conf/minion b/conf/minion
index 52443204cb4c..f5d1f2284cfe 100644
index b408942..32b0d0a 100644
--- a/conf/minion
+++ b/conf/minion
@@ -538,7 +538,7 @@
@@ -451,7 +451,7 @@
#
# Warning: Prior to changing this value, the minion should be stopped and all
# Salt caches should be cleared.
@ -36,10 +36,10 @@ index 52443204cb4c..f5d1f2284cfe 100644
# 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 7b835e25ea52..ab500f9c7cfe 100644
index e6ca631..e697357 100644
--- a/conf/proxy
+++ b/conf/proxy
@@ -435,7 +435,7 @@
@@ -427,7 +427,7 @@
#
# Warning: Prior to changing this value, the minion should be stopped and all
# Salt caches should be cleared.
@ -49,5 +49,5 @@ index 7b835e25ea52..ab500f9c7cfe 100644
# 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.8.3
2.1.4

View File

@ -1,7 +1,7 @@
From 46476c37aa00d9cbbd0ac58e56b7e1c134d33b13 Mon Sep 17 00:00:00 2001
From e2236cc77888d3c359c23dfb47a57e1e057864bb Mon Sep 17 00:00:00 2001
From: Christian McHugh <mchugh19@hotmail.com>
Date: Thu, 10 Mar 2016 13:25:01 -0600
Subject: [PATCH 06/13] Create salt-proxy instantiated service file
Subject: [PATCH 6/7] Create salt-proxy instantiated service file
Add a systemd service file for salt-proxy.
@ -15,7 +15,7 @@ Instantiate a new proxy service with proxyid=p8000:
diff --git a/pkg/salt-proxy@.service b/pkg/salt-proxy@.service
new file mode 100644
index 000000000000..f97120a05589
index 0000000..f97120a
--- /dev/null
+++ b/pkg/salt-proxy@.service
@@ -0,0 +1,12 @@
@ -32,5 +32,5 @@ index 000000000000..f97120a05589
+[Install]
+WantedBy=multi-user.target
--
2.8.3
2.8.2

View File

@ -1,7 +1,7 @@
From 65a32350589712835294bb5e671c42ef1d331df8 Mon Sep 17 00:00:00 2001
From df87ac3485ff8b5013e720435905afda6b53ada8 Mon Sep 17 00:00:00 2001
From: Bo Maryniuk <bo@suse.de>
Date: Mon, 9 May 2016 10:33:44 +0200
Subject: [PATCH 07/13] Add SUSE Manager plugin
Subject: [PATCH 7/7] Add SUSE Manager plugin
* Add unit test to the libzypp drift detector plugin
---
@ -17,7 +17,7 @@ Subject: [PATCH 07/13] Add SUSE Manager plugin
diff --git a/scripts/zypper/plugins/commit/README.md b/scripts/zypper/plugins/commit/README.md
new file mode 100644
index 000000000000..01c8917c8e0a
index 0000000..01c8917
--- /dev/null
+++ b/scripts/zypper/plugins/commit/README.md
@@ -0,0 +1,3 @@
@ -26,7 +26,7 @@ index 000000000000..01c8917c8e0a
+Plugins here are required to interact with SUSE Manager in conjunction of SaltStack and Zypper.
diff --git a/scripts/zypper/plugins/commit/susemanager b/scripts/zypper/plugins/commit/susemanager
new file mode 100755
index 000000000000..268298b10811
index 0000000..268298b
--- /dev/null
+++ b/scripts/zypper/plugins/commit/susemanager
@@ -0,0 +1,59 @@
@ -91,7 +91,7 @@ index 000000000000..268298b10811
+DriftDetector().main()
diff --git a/tests/unit/zypp_plugins_test.py b/tests/unit/zypp_plugins_test.py
new file mode 100644
index 000000000000..6075288aad39
index 0000000..6075288
--- /dev/null
+++ b/tests/unit/zypp_plugins_test.py
@@ -0,0 +1,51 @@
@ -148,7 +148,7 @@ index 000000000000..6075288aad39
+ run_tests(ZyppPluginsTestCase, needs_daemon=False)
diff --git a/tests/zypp_plugin.py b/tests/zypp_plugin.py
new file mode 100644
index 000000000000..218f70381146
index 0000000..218f703
--- /dev/null
+++ b/tests/zypp_plugin.py
@@ -0,0 +1,64 @@
@ -217,5 +217,5 @@ index 000000000000..218f70381146
+ '''
+ self.closed = True
--
2.8.3
2.8.2

View File

@ -1,14 +1,14 @@
From ba369d65b7383be082ea1b72ea9327f92ca35920 Mon Sep 17 00:00:00 2001
From 46713681bda8e45667691fbda6efe808c81574b1 Mon Sep 17 00:00:00 2001
From: Bo Maryniuk <bo@suse.de>
Date: Mon, 23 May 2016 17:29:15 +0200
Subject: [PATCH 08/13] Prevent several minion processes on the same machine
Subject: [PATCH 8/8] Prevent several minion processes on the same machine
---
pkg/suse/salt-minion | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pkg/suse/salt-minion b/pkg/suse/salt-minion
index 957b2aa7069b..32ed5bb517ae 100644
index c476fab..28cf32c 100644
--- a/pkg/suse/salt-minion
+++ b/pkg/suse/salt-minion
@@ -55,7 +55,7 @@ RETVAL=0

View File

@ -1,8 +1,8 @@
From 939838566b7f73970fe0a6d816a419ff2bbcbca4 Mon Sep 17 00:00:00 2001
From d27af7dee61e83165bbd9adb9f0b6dc467907faa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez@suse.com>
Date: Tue, 24 May 2016 11:01:55 +0100
Subject: [PATCH 09/13] checksum validation when zypper pkg.download
Subject: [PATCH 09/11] checksum validation when zypper pkg.download
check the signature of downloaded RPM files
@ -13,14 +13,14 @@ Renamed check_sig to checksum and some refactoring
simpler rpm.checksum function
---
salt/modules/rpm.py | 26 ++++++++++++++++++++++++++
salt/modules/zypper.py | 9 +++++----
2 files changed, 31 insertions(+), 4 deletions(-)
salt/modules/zypper.py | 6 +++++-
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/salt/modules/rpm.py b/salt/modules/rpm.py
index bcdf553ac91b..eb27bb588102 100644
index 1469368..4991f24 100644
--- a/salt/modules/rpm.py
+++ b/salt/modules/rpm.py
@@ -606,3 +606,29 @@ def version_cmp(ver1, ver2):
@@ -602,3 +602,29 @@ def version_cmp(ver1, ver2):
log.warning("Failed to compare version '{0}' to '{1}' using RPM: {2}".format(ver1, ver2, exc))
return salt.utils.version_cmp(ver1, ver2)
@ -51,17 +51,14 @@ index bcdf553ac91b..eb27bb588102 100644
+
+ return ret
diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index 13afd5afff9e..03ca6e6a1fcd 100644
index f9538e5..39b071b 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -1578,12 +1578,13 @@ def download(*packages, **kwargs):
'repository-name': repo.getAttribute('name'),
'repository-alias': repo.getAttribute('alias'),
@@ -1534,9 +1534,13 @@ def download(*packages, **kwargs):
'repository-alias': repo.getAttribute("alias"),
'path': dld_result.getElementsByTagName("localfile")[0].getAttribute("path"),
}
- key = _get_first_aggregate_text(
- dld_result.getElementsByTagName('name')
- )
- pkg_ret[key] = pkg_info
- pkg_ret[_get_first_aggregate_text(dld_result.getElementsByTagName("name"))] = pkg_info
+ if __salt__['lowpkg.checksum'](pkg_info['path']):
+ pkg_ret[_get_first_aggregate_text(dld_result.getElementsByTagName("name"))] = pkg_info
@ -71,7 +68,7 @@ index 13afd5afff9e..03ca6e6a1fcd 100644
+ pkg_ret['_error'] = ('The following package(s) failed to download: {0}'.format(', '.join(failed)))
return pkg_ret
raise CommandExecutionError(
raise CommandExecutionError("Unable to download packages: {0}.".format(', '.join(packages)))
--
2.8.3
2.8.2

View File

@ -1,8 +1,8 @@
From 5e3be325c8a0fe0a974580b7329028d49825d80a Mon Sep 17 00:00:00 2001
From 2742ee76ccc50cd4f84e44861ef82ec5f3b5234a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez@suse.com>
Date: Wed, 25 May 2016 17:08:16 +0100
Subject: [PATCH 10/13] unit tests for rpm.checksum() and zypper.download()
Subject: [PATCH 10/11] unit tests for rpm.checksum() and zypper.download()
lint issue fixed
---
@ -13,7 +13,7 @@ lint issue fixed
create mode 100644 tests/unit/modules/zypp/zypper-download.xml
diff --git a/tests/unit/modules/rpm_test.py b/tests/unit/modules/rpm_test.py
index f180736f274a..4042137a47ef 100644
index f180736..4042137 100644
--- a/tests/unit/modules/rpm_test.py
+++ b/tests/unit/modules/rpm_test.py
@@ -95,6 +95,22 @@ class RpmTestCase(TestCase):
@ -41,7 +41,7 @@ index f180736f274a..4042137a47ef 100644
'''
diff --git a/tests/unit/modules/zypp/zypper-download.xml b/tests/unit/modules/zypp/zypper-download.xml
new file mode 100644
index 000000000000..eeea0a57b54a
index 0000000..eeea0a5
--- /dev/null
+++ b/tests/unit/modules/zypp/zypper-download.xml
@@ -0,0 +1,19 @@
@ -65,7 +65,7 @@ index 000000000000..eeea0a57b54a
+ <message type="info">download: Done.</message>
+</stream>
diff --git a/tests/unit/modules/zypper_test.py b/tests/unit/modules/zypper_test.py
index 4e735cde261a..9ec2b83deb4f 100644
index 4e735cd..9ec2b83 100644
--- a/tests/unit/modules/zypper_test.py
+++ b/tests/unit/modules/zypper_test.py
@@ -354,6 +354,31 @@ class ZypperTestCase(TestCase):
@ -101,5 +101,5 @@ index 4e735cde261a..9ec2b83deb4f 100644
'''
Test package removal
--
2.8.3
2.8.2

View File

@ -1,8 +1,8 @@
From 516e4785dd3a0276c31ec4c5cf9ce651fe5a7063 Mon Sep 17 00:00:00 2001
From e0f15c5292869549b5c80997ccb3282961be8e49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez@suse.com>
Date: Tue, 24 May 2016 09:21:43 +0100
Subject: [PATCH 11/13] jobs.exit_success allow to check if a job has executed
Subject: [PATCH 11/11] jobs.exit_success allow to check if a job has executed
and exit successfully
jobs.exit_success() now works parsing the results of jobs.lookup_id()
@ -11,7 +11,7 @@ jobs.exit_success() now works parsing the results of jobs.lookup_id()
1 file changed, 27 insertions(+)
diff --git a/salt/runners/jobs.py b/salt/runners/jobs.py
index def40976fccf..6e37ab0d0ee6 100644
index 57d0324..e2b8737 100644
--- a/salt/runners/jobs.py
+++ b/salt/runners/jobs.py
@@ -488,6 +488,33 @@ def print_job(jid, ext_source=None, outputter=None):
@ -49,5 +49,5 @@ index def40976fccf..6e37ab0d0ee6 100644
outputter=None,
metadata=None,
--
2.8.3
2.8.2

View File

@ -1,7 +1,7 @@
From 9d5f4b9de1a98890d5cdccbc2672d7ac720f3af2 Mon Sep 17 00:00:00 2001
From b0e1ba5158cc4b54102bac200ae343935eeb2db5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mihai=20Dinc=C4=83?= <dincamihai@users.noreply.github.com>
Date: Mon, 23 May 2016 23:15:29 +0200
Subject: [PATCH 12/13] Fix pkgrepo.managed gpgkey argument (bsc#979448)
Subject: [PATCH 12/12] Fix pkgrepo.managed gpgkey argument (bsc#979448)
* Call zypper refresh after adding/modifying a repository
@ -29,10 +29,10 @@ accepting/rejecting the gpg key.
2 files changed, 229 insertions(+), 8 deletions(-)
diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index 03ca6e6a1fcd..b42eec824ccb 100644
index 39b071b..2c72448 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -770,6 +770,8 @@ def mod_repo(repo, **kwargs):
@@ -767,6 +767,8 @@ def mod_repo(repo, **kwargs):
# Modify added or existing repo according to the options
cmd_opt = []
@ -41,7 +41,7 @@ index 03ca6e6a1fcd..b42eec824ccb 100644
if 'enabled' in kwargs:
cmd_opt.append(kwargs['enabled'] and '--enable' or '--disable')
@@ -785,21 +787,27 @@ def mod_repo(repo, **kwargs):
@@ -780,21 +782,27 @@ def mod_repo(repo, **kwargs):
if 'gpgcheck' in kwargs:
cmd_opt.append(kwargs['gpgcheck'] and '--gpgcheck' or '--no-gpgcheck')
@ -78,7 +78,7 @@ index 03ca6e6a1fcd..b42eec824ccb 100644
'Specified arguments did not result in modification of repo'
)
diff --git a/tests/unit/modules/zypper_test.py b/tests/unit/modules/zypper_test.py
index 9ec2b83deb4f..c4f7597bb96c 100644
index 9ec2b83..c4f7597 100644
--- a/tests/unit/modules/zypper_test.py
+++ b/tests/unit/modules/zypper_test.py
@@ -9,7 +9,9 @@ from __future__ import absolute_import

View File

@ -1,218 +0,0 @@
From 10d5f4c4a979782efa94837a71d51c0c6fa12316 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez@suse.com>
Date: Thu, 2 Jun 2016 11:50:36 +0100
Subject: [PATCH 13/13] fix groupadd module for sles11 systems
one line is better
improvements on groupadd unit tests
test_members cleanup
pylint fix
---
salt/modules/groupadd.py | 17 +++++-
tests/unit/modules/groupadd_test.py | 116 +++++++++++++++++++++++-------------
2 files changed, 90 insertions(+), 43 deletions(-)
diff --git a/salt/modules/groupadd.py b/salt/modules/groupadd.py
index 6d963b1d1ebb..36d0e8da6a0d 100644
--- a/salt/modules/groupadd.py
+++ b/salt/modules/groupadd.py
@@ -166,10 +166,13 @@ def adduser(name, username, root=None):
if not then adds it.
'''
on_redhat_5 = __grains__.get('os_family') == 'RedHat' and __grains__.get('osmajorrelease') == '5'
+ on_suse_11 = __grains__.get('os_family') == 'Suse' and __grains__.get('osrelease_info')[0] == 11
if __grains__['kernel'] == 'Linux':
if on_redhat_5:
- cmd = ('gpasswd', '-a', username, name)
+ cmd = 'gpasswd -a {0} {1}'.format(username, name)
+ elif on_suse_11:
+ cmd = 'usermod -A {0} {1}'.format(name, username)
else:
cmd = ('gpasswd', '--add', username, name)
if root is not None:
@@ -198,13 +201,16 @@ def deluser(name, username, root=None):
then returns True.
'''
on_redhat_5 = __grains__.get('os_family') == 'RedHat' and __grains__.get('osmajorrelease') == '5'
+ on_suse_11 = __grains__.get('os_family') == 'Suse' and __grains__.get('osrelease_info')[0] == 11
grp_info = __salt__['group.info'](name)
try:
if username in grp_info['members']:
if __grains__['kernel'] == 'Linux':
if on_redhat_5:
- cmd = ('gpasswd', '-d', username, name)
+ cmd = 'gpasswd -d {0} {1}'.format(username, name)
+ elif on_suse_11:
+ cmd = 'usermod -R {0} {1}'.format(name, username)
else:
cmd = ('gpasswd', '--del', username, name)
if root is not None:
@@ -239,10 +245,15 @@ def members(name, members_list, root=None):
foo:x:1234:user1,user2,user3,...
'''
on_redhat_5 = __grains__.get('os_family') == 'RedHat' and __grains__.get('osmajorrelease') == '5'
+ on_suse_11 = __grains__.get('os_family') == 'Suse' and __grains__.get('osrelease_info')[0] == 11
if __grains__['kernel'] == 'Linux':
if on_redhat_5:
- cmd = ('gpasswd', '-M', members_list, name)
+ cmd = 'gpasswd -M {0} {1}'.format(members_list, name)
+ elif on_suse_11:
+ for old_member in __salt__['group.info'](name).get('members'):
+ __salt__['cmd.run']('groupmod -R {0} {1}'.format(old_member, name), python_shell=False)
+ cmd = 'groupmod -A {0} {1}'.format(members_list, name)
else:
cmd = ('gpasswd', '--members', members_list, name)
if root is not None:
diff --git a/tests/unit/modules/groupadd_test.py b/tests/unit/modules/groupadd_test.py
index b1519014cfd0..c0c0a748dbb5 100644
--- a/tests/unit/modules/groupadd_test.py
+++ b/tests/unit/modules/groupadd_test.py
@@ -112,14 +112,26 @@ class GroupAddTestCase(TestCase):
'''
Tests if specified user gets added in the group.
'''
- mock = MagicMock(return_value={'retcode': 0})
- with patch.dict(groupadd.__grains__, {'kernel': 'Linux'}):
- with patch.dict(groupadd.__salt__, {'cmd.retcode': mock}):
- self.assertFalse(groupadd.adduser('test', 'root'))
+ os_version_list = [
+ {'grains': {'kernel': 'Linux', 'os_family': 'RedHat', 'osmajorrelease': '5'},
+ 'cmd': 'gpasswd -a root test'},
+
+ {'grains': {'kernel': 'Linux', 'os_family': 'Suse', 'osrelease_info': [11, 2]},
+ 'cmd': 'usermod -A test root'},
+
+ {'grains': {'kernel': 'Linux'},
+ 'cmd': 'gpasswd --add root test'},
- with patch.dict(groupadd.__grains__, {'kernel': ''}):
- with patch.dict(groupadd.__salt__, {'cmd.retcode': mock}):
- self.assertFalse(groupadd.adduser('test', 'root'))
+ {'grains': {'kernel': 'OTHERKERNEL'},
+ 'cmd': 'usermod -G test root'},
+ ]
+
+ for os_version in os_version_list:
+ mock = MagicMock(return_value={'retcode': 0})
+ with patch.dict(groupadd.__grains__, os_version['grains']):
+ with patch.dict(groupadd.__salt__, {'cmd.retcode': mock}):
+ self.assertFalse(groupadd.adduser('test', 'root'))
+ groupadd.__salt__['cmd.retcode'].assert_called_once_with(os_version['cmd'], python_shell=False)
# 'deluser' function tests: 1
@@ -127,22 +139,34 @@ class GroupAddTestCase(TestCase):
'''
Tests if specified user gets deleted from the group.
'''
- mock_ret = MagicMock(return_value={'retcode': 0})
- mock_info = MagicMock(return_value={'passwd': '*',
- 'gid': 0,
- 'name': 'test',
- 'members': ['root']})
- with patch.dict(groupadd.__grains__, {'kernel': 'Linux'}):
- with patch.dict(groupadd.__salt__, {'cmd.retcode': mock_ret,
- 'group.info': mock_info}):
- self.assertFalse(groupadd.deluser('test', 'root'))
+ os_version_list = [
+ {'grains': {'kernel': 'Linux', 'os_family': 'RedHat', 'osmajorrelease': '5'},
+ 'cmd': 'gpasswd -d root test'},
- mock_stdout = MagicMock(return_value={'cmd.run_stdout': 1})
- with patch.dict(groupadd.__grains__, {'kernel': 'OpenBSD'}):
- with patch.dict(groupadd.__salt__, {'cmd.retcode': mock_ret,
- 'group.info': mock_info,
- 'cmd.run_stdout': mock_stdout}):
- self.assertTrue(groupadd.deluser('foo', 'root'))
+ {'grains': {'kernel': 'Linux', 'os_family': 'Suse', 'osrelease_info': [11, 2]},
+ 'cmd': 'usermod -R test root'},
+
+ {'grains': {'kernel': 'Linux'},
+ 'cmd': 'gpasswd --del root test'},
+
+ {'grains': {'kernel': 'OpenBSD'},
+ 'cmd': 'usermod -S foo root'},
+ ]
+
+ for os_version in os_version_list:
+ mock_ret = MagicMock(return_value={'retcode': 0})
+ mock_stdout = MagicMock(return_value='test foo')
+ mock_info = MagicMock(return_value={'passwd': '*',
+ 'gid': 0,
+ 'name': 'test',
+ 'members': ['root']})
+
+ with patch.dict(groupadd.__grains__, os_version['grains']):
+ with patch.dict(groupadd.__salt__, {'cmd.retcode': mock_ret,
+ 'group.info': mock_info,
+ 'cmd.run_stdout': mock_stdout}):
+ self.assertFalse(groupadd.deluser('test', 'root'))
+ groupadd.__salt__['cmd.retcode'].assert_called_once_with(os_version['cmd'], python_shell=False)
# 'deluser' function tests: 1
@@ -150,24 +174,36 @@ class GroupAddTestCase(TestCase):
'''
Tests if members of the group, get replaced with a provided list.
'''
- mock_ret = MagicMock(return_value={'retcode': 0})
- mock_info = MagicMock(return_value={'passwd': '*',
- 'gid': 0,
- 'name': 'test',
- 'members': ['root']})
- with patch.dict(groupadd.__grains__, {'kernel': 'Linux'}):
- with patch.dict(groupadd.__salt__, {'cmd.retcode': mock_ret,
- 'group.info': mock_info}):
- self.assertFalse(groupadd.members('test', ['foo']))
-
- mock_stdout = MagicMock(return_value={'cmd.run_stdout': 1})
- mock = MagicMock()
- with patch.dict(groupadd.__grains__, {'kernel': 'OpenBSD'}):
- with patch.dict(groupadd.__salt__, {'cmd.retcode': mock_ret,
- 'group.info': mock_info,
- 'cmd.run_stdout': mock_stdout,
- 'cmd.run': mock}):
- self.assertFalse(groupadd.members('foo', ['root']))
+ os_version_list = [
+ {'grains': {'kernel': 'Linux', 'os_family': 'RedHat', 'osmajorrelease': '5'},
+ 'cmd': "gpasswd -M foo test"},
+
+ {'grains': {'kernel': 'Linux', 'os_family': 'Suse', 'osrelease_info': [11, 2]},
+ 'cmd': 'groupmod -A foo test'},
+
+ {'grains': {'kernel': 'Linux'},
+ 'cmd': 'gpasswd --members foo test'},
+
+ {'grains': {'kernel': 'OpenBSD'},
+ 'cmd': 'usermod -G test foo'},
+ ]
+
+ for os_version in os_version_list:
+ mock_ret = MagicMock(return_value={'retcode': 0})
+ mock_stdout = MagicMock(return_value={'cmd.run_stdout': 1})
+ mock_info = MagicMock(return_value={'passwd': '*',
+ 'gid': 0,
+ 'name': 'test',
+ 'members': ['root']})
+ mock = MagicMock(return_value=True)
+
+ with patch.dict(groupadd.__grains__, os_version['grains']):
+ with patch.dict(groupadd.__salt__, {'cmd.retcode': mock_ret,
+ 'group.info': mock_info,
+ 'cmd.run_stdout': mock_stdout,
+ 'cmd.run': mock}):
+ self.assertFalse(groupadd.members('test', 'foo'))
+ groupadd.__salt__['cmd.retcode'].assert_called_once_with(os_version['cmd'], python_shell=False)
if __name__ == '__main__':
--
2.8.3

View File

@ -1,38 +0,0 @@
From 7ccd232e4d47778b2ede7a7f318baa41c39d6a0c Mon Sep 17 00:00:00 2001
From: Mike Place <mp@saltstack.com>
Date: Thu, 26 May 2016 11:14:56 -0600
Subject: [PATCH 14/14] Fix crashing Maintenence process
The first time through the loop we deleted the dir and then stack
traced the second time through the loop if we hit the other conditional.
Resolves #33544
---
salt/returners/local_cache.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/salt/returners/local_cache.py b/salt/returners/local_cache.py
index 17d5066b218f..8bd833b5f99f 100644
--- a/salt/returners/local_cache.py
+++ b/salt/returners/local_cache.py
@@ -407,14 +407,14 @@ def clean_old_jobs():
for final in t_path_dirs:
f_path = os.path.join(t_path, final)
jid_file = os.path.join(f_path, 'jid')
- if not os.path.isfile(jid_file):
+ if not os.path.isfile(jid_file) and os.path.exists(t_path):
# No jid file means corrupted cache entry, scrub it
# by removing the entire t_path directory
shutil.rmtree(t_path)
- else:
+ elif os.path.isfile(jid_file):
jid_ctime = os.stat(jid_file).st_ctime
hours_difference = (cur - jid_ctime) / 3600.0
- if hours_difference > __opts__['keep_jobs']:
+ if hours_difference > __opts__['keep_jobs'] and os.path.exists(t_path):
# Remove the entire t_path from the original JID dir
shutil.rmtree(t_path)
--
2.8.3

3
salt-2015.8.10.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4a81273ab4b01e0f1d29b28ab99a16eb94e5c430107b05491c94f3baf8b95c99
size 6972776

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e316dd103b7faeaa97820197e4d0d7d358519f0ca2a6dcb1d9b718eea801ed30
size 7913503

View File

@ -1,16 +1,3 @@
-------------------------------------------------------------------
Wed Jun 15 11:38:26 UTC 2016 - kkaempf@suse.com
- Update to v2016.3.0
see https://docs.saltstack.com/en/latest/topics/releases/2016.3.0.html
* backwards-incompatible changes:
- The default path for the extension_modules master config option
has been changed.
- add 0014-Fix-crashing-Maintenence-process.patch
see release notes
-------------------------------------------------------------------
Wed Jun 1 09:52:40 UTC 2016 - mihai.dinca@suse.com

View File

@ -36,7 +36,7 @@
%bcond_without docs
Name: salt
Version: 2016.3.0
Version: 2015.8.10
Release: 0
Summary: A parallel remote execution system
License: Apache-2.0
@ -73,10 +73,6 @@ Patch11: 0011-jobs.exit_success-allow-to-check-if-a-job-has-execut.patch
# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/33432
# https://github.com/saltstack/salt/pull/33581
Patch12: 0012-Fix-pkgrepo.managed-gpgkey-argument-bsc-979448.patch
# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/33712
Patch13: 0013-fix-groupadd-module-for-sles11-systems.patch
# PATCH-FIX-UPSTREAM https://github.com/saltstack/salt/pull/33555
Patch14: 0014-Fix-crashing-Maintenence-process.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: logrotate
@ -119,9 +115,6 @@ BuildRequires: python-xml
#for docs
BuildRequires: python-sphinx
%endif
%if 0%{?suse_version} > 1010
BuildRequires: fdupes
%endif
Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd
@ -441,8 +434,6 @@ cp %{S:1} .
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%build
python setup.py --salt-transport=both build
@ -555,11 +546,6 @@ install -Dpm 0644 pkg/fish-completions/* %{buildroot}%{fish_completions_dir}
echo "transport: raet" > %{buildroot}%{_sysconfdir}/salt/master.d/transport-raet.conf
echo "transport: raet" > %{buildroot}%{_sysconfdir}/salt/minion.d/transport-raet.conf
%if 0%{?suse_version} > 1020
%fdupes %{buildroot}%{_docdir}
%fdupes %{buildroot}%{python_sitelib}
%endif
%check
%if %{with test}
python setup.py test --runtests-opts=-u
@ -574,45 +560,6 @@ getent passwd salt >/dev/null || %{_sbindir}/useradd -r -g salt -d /srv/salt -s
systemd-tmpfiles --create /usr/lib/tmpfiles.d/salt.conf || true
%endif
%preun proxy
%if %{with systemd}
%service_del_preun salt-proxy@.service
%else
%if 0%{?suse_version}
%stop_on_removal salt-proxy
%else
if [ $1 -eq 0 ] ; then
/sbin/service salt-proxy stop >/dev/null 2>&1
/sbin/chkconfig --del salt-proxy
fi
%endif
%endif
%pre proxy
%if %{with systemd}
%service_add_pre salt-proxy@.service
%endif
%post proxy
%if %{with systemd}
%service_add_post salt-proxy@.service
%fillup_only
%else
%if 0%{?suse_version}
%fillup_and_insserv
%endif
%endif
%postun proxy
%if %{with systemd}
%service_del_postun salt-proxy@.service
%else
%if 0%{?suse_version}
%insserv_cleanup
%restart_on_update salt-proxy
%endif
%endif
%preun syndic
%if %{with systemd}
%service_del_preun salt-syndic.service
@ -834,7 +781,6 @@ fi
%dir %attr(0750, root, root) %{_sysconfdir}/salt/minion.d/
%dir %attr(0750, root, root) %{_sysconfdir}/salt/pki/minion/
%dir %attr(0750, root, root) %{_localstatedir}/cache/salt/minion/
#%dir %ghost %attr(0750, root, salt) %{_localstatedir}/run/salt/minion
%{_sbindir}/rcsalt-minion
# Install plugin only on SUSE machines
@ -894,7 +840,6 @@ fi
%dir %attr(0750, salt, salt) %{_localstatedir}/cache/salt/master/roots/
%dir %attr(0750, salt, salt) %{_localstatedir}/cache/salt/master/syndics/
%dir %attr(0750, salt, salt) %{_localstatedir}/cache/salt/master/tokens/
#%dir %ghost %attr(0750, salt, salt) %{_localstatedir}/run/salt/master/
%files raet
%defattr(-,root,root,-)
@ -908,19 +853,17 @@ fi
%{_bindir}/salt-unity
%{_mandir}/man1/salt-unity.1.gz
%{_mandir}/man1/salt-call.1.gz
%{_mandir}/man1/spm.1.gz
%config(noreplace) %{_sysconfdir}/logrotate.d/salt
%{python_sitelib}/*
%exclude %{python_sitelib}/salt/cloud/deploy/*.sh
%attr(755,root,root)%{python_sitelib}/salt/cloud/deploy/*.sh
%doc LICENSE AUTHORS README.rst HACKING.rst README.SUSE
#
%dir %attr(0750, root, salt) %{_sysconfdir}/salt
%dir %attr(0750, root, salt) %{_sysconfdir}/salt/pki
%dir %attr(0750, salt, salt) %{_localstatedir}/log/salt
%dir %attr(0750, root, salt) %{_localstatedir}/cache/salt
#%dir %ghost %attr(0750, root, salt) %{_localstatedir}/run/salt
%dir %attr(0750, root, salt) /srv/spm
%dir %attr(0750, root, salt) %{_sysconfdir}/salt
%dir %attr(0750, root, salt) %{_sysconfdir}/salt/pki
%dir %attr(0750, salt, salt) %{_localstatedir}/log/salt
%dir %attr(0750, root, salt) %{_localstatedir}/cache/salt
%dir %attr(0750, root, salt) /srv/spm
%if %{with systemd}
/usr/lib/tmpfiles.d/salt.conf
%endif