[salt/f19] Update to feature release 0.17.0.

Erik Johnson terminalmage at fedoraproject.org
Tue Oct 1 01:58:37 UTC 2013


commit 3a7a5db5a9900a5b772b3bf82d1b340c367271d3
Author: Erik Johnson <erik at saltstack.com>
Date:   Mon Sep 30 20:58:03 2013 -0500

    Update to feature release 0.17.0.

 .gitignore  |    2 +
 salt-master |   41 ++++++++++++++++----------
 salt-minion |   53 ++++++++++++++++++++++------------
 salt-syndic |   42 +++++++++++++++++----------
 salt.spec   |   90 +++++++++++++++++++++++++++++++++++-----------------------
 sources     |    3 +-
 6 files changed, 143 insertions(+), 88 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 812beed..a32cba0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,3 +24,5 @@
 /salt-0.16.2.tar.gz
 /salt-0.16.3.tar.gz
 /salt-0.16.4.tar.gz
+/SaltTesting-0.5.1.tar.gz
+/salt-0.17.0.tar.gz
diff --git a/salt-master b/salt-master
index 3e47ccb..a05ef35 100644
--- a/salt-master
+++ b/salt-master
@@ -6,21 +6,23 @@
 # LSB header
 
 ### BEGIN INIT INFO
-# Description: This is a daemon that controls the salt minions
-# Provides: salt-master
-# Required-Start: network
-# Short-Description: salt master control daemon
+# Provides:          salt-master
+# Required-Start:    $all
+# Required-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Salt master control daemon
+# Description:       This is a daemon that controls the Salt minions.
 ### END INIT INFO
 
+
 # chkconfig header
 
-# chkconfig: 345 99 99 
-# description:  This is a daemon that controls the salt minions
+# chkconfig: 345 96 05
+# description:  This is a daemon that controls the Salt minions
 #
 # processname: /usr/bin/salt-master
 
-# Sanity checks.
-[ -x /usr/bin/salt-master ] || exit 0
 
 DEBIAN_VERSION=/etc/debian_version
 SUSE_RELEASE=/etc/SuSE-release
@@ -33,27 +35,35 @@ else
     . /etc/rc.d/init.d/functions
 fi
 
+# Default values (can be overridden below)
+SALTMASTER=/usr/bin/salt-master
+PYTHON=/usr/bin/python
+MASTER_ARGS=""
+
+if [ -f /etc/default/salt ]; then
+    . /etc/default/salt
+fi
+
 SERVICE=salt-master
 PROCESS=salt-master
-CONFIG_ARGS=" "
 
 RETVAL=0
 
 start() {
     echo -n $"Starting salt-master daemon: "
     if [ -f $SUSE_RELEASE ]; then
-        startproc -f -p /var/run/$SERVICE.pid /usr/bin/salt-master -d $CONFIG_ARGS
+        startproc -f -p /var/run/$SERVICE.pid $SALTMASTER -d $MASTER_ARGS
         rc_status -v
     elif [ -e $DEBIAN_VERSION ]; then
         if [ -f $LOCKFILE ]; then
             echo -n "already started, lock file found" 
             RETVAL=1
-        elif /usr/bin/python /usr/bin/salt-master -d; then
+        elif $PYTHON $SALTMASTER -d $MASTER_ARGS >& /dev/null; then
             echo -n "OK"
             RETVAL=0
         fi
     else
-        daemon --check $SERVICE $PROCESS -d $CONFIG_ARGS
+        daemon --check $SERVICE $SALTMASTER -d $MASTER_ARGS
     fi
     RETVAL=$?
     echo
@@ -63,11 +73,11 @@ start() {
 stop() {
     echo -n $"Stopping salt-master daemon: "
     if [ -f $SUSE_RELEASE ]; then
-        killproc -TERM /usr/bin/salt-master
+        killproc -TERM $SALTMASTER
         rc_status -v
     elif [ -f $DEBIAN_VERSION ]; then
         # Added this since Debian's start-stop-daemon doesn't support spawned processes
-        if ps -ef | grep "/usr/bin/python /usr/bin/salt-master" | grep -v grep | awk '{print $2}' | xargs kill &> /dev/null; then
+        if ps -ef | grep "$PYTHON $SALTMASTER" | grep -v grep | awk '{print $2}' | xargs kill &> /dev/null; then
             echo -n "OK"
             RETVAL=0
         else
@@ -94,7 +104,7 @@ case "$1" in
     status)
         if [ -f $SUSE_RELEASE ]; then
             echo -n "Checking for service salt-master "
-            checkproc /usr/bin/salt-master
+            checkproc $SALTMASTER
             rc_status -v
         elif [ -f $DEBIAN_VERSION ]; then
             if [ -f $LOCKFILE ]; then
@@ -122,4 +132,3 @@ case "$1" in
         ;;
 esac
 exit $RETVAL
-
diff --git a/salt-minion b/salt-minion
index 399c840..2ef39c9 100644
--- a/salt-minion
+++ b/salt-minion
@@ -6,56 +6,72 @@
 # LSB header
 
 ### BEGIN INIT INFO
-# Provides: salt-minion
-# Required-Start: network
-# Short-Description: salt minion control daemon
-# Description: This is a daemon that controls the salt minions
+# Provides:          salt-minion
+# Required-Start:    $all
+# Required-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Salt minion daemon
+# Description:       This is the Salt minion daemon that can be controlled by the
+#                    Salt master.
 ### END INIT INFO
 
+
 # chkconfig header
 
-# chkconfig: 345 99 99 
-# description:  This is a daemon that controls the salt mininons
+# chkconfig: 345 97 04
+# description:  This is the Salt minion daemon that can be controlled by the Salt master.
 #
 # processname: /usr/bin/salt-minion
 
-# Sanity checks.
-[ -x /usr/bin/salt-minion ] || exit 0
 
 DEBIAN_VERSION=/etc/debian_version
 SUSE_RELEASE=/etc/SuSE-release
 # Source function library.
 if [ -f $DEBIAN_VERSION ]; then
-   break   
+   break
 elif [ -f $SUSE_RELEASE -a -r /etc/rc.status ]; then
     . /etc/rc.status
 else
     . /etc/rc.d/init.d/functions
 fi
 
+# Default values (can be overridden below)
+SALTMINION=/usr/bin/salt-minion
+PYTHON=/usr/bin/python
+MINION_ARGS=""
+
+if [ -f /etc/default/salt ]; then
+    . /etc/default/salt
+fi
+
 SERVICE=salt-minion
 PROCESS=salt-minion
-CONFIG_ARGS=" "
 
 RETVAL=0
 
 start() {
     echo -n $"Starting salt-minion daemon: "
     if [ -f $SUSE_RELEASE ]; then
-        startproc -f -p /var/run/$SERVICE.pid /usr/bin/salt-minion -d $CONFIG_ARGS
+        startproc -f -p /var/run/$SERVICE.pid $SALTMINION -d $MINION_ARGS
         rc_status -v
     elif [ -e $DEBIAN_VERSION ]; then
         if [ -f $LOCKFILE ]; then
-            echo -n "already started, lock file found" 
+            echo -n "already started, lock file found"
             RETVAL=1
-        elif /usr/bin/python /usr/bin/salt-minion -d; then
+        elif $PYTHON $SALTMINION -d $MINION_ARGS >& /dev/null; then
             echo -n "OK"
             RETVAL=0
         fi
     else
-        daemon --check $SERVICE $PROCESS -d $CONFIG_ARGS
+        if [ $(pidofproc $PROCESS) ]; then
+	          RETVAL=$?
+	          echo -n "already running"
+        else
+	          daemon --check $SERVICE $SALTMINION -d $MINION_ARGS
+	          RETVAL=$?
+        fi
     fi
-    RETVAL=$?
     echo
     return $RETVAL
 }
@@ -63,11 +79,11 @@ start() {
 stop() {
     echo -n $"Stopping salt-minion daemon: "
     if [ -f $SUSE_RELEASE ]; then
-        killproc -TERM /usr/bin/salt-minion
+        killproc -TERM $SALTMINION
         rc_status -v
     elif [ -f $DEBIAN_VERSION ]; then
         # Added this since Debian's start-stop-daemon doesn't support spawned processes
-        if ps -ef | grep "/usr/bin/python /usr/bin/salt-minion" | grep -v grep | awk '{print $2}' | xargs kill &> /dev/null; then
+        if ps -ef | grep "$PYTHON $SALTMINION" | grep -v grep | awk '{print $2}' | xargs kill &> /dev/null; then
             echo -n "OK"
             RETVAL=0
         else
@@ -94,7 +110,7 @@ case "$1" in
     status)
         if [ -f $SUSE_RELEASE ]; then
             echo -n "Checking for service salt-minion "
-            checkproc /usr/bin/salt-minion
+            checkproc $SALTMINION
             rc_status -v
         elif [ -f $DEBIAN_VERSION ]; then
             if [ -f $LOCKFILE ]; then
@@ -122,4 +138,3 @@ case "$1" in
         ;;
 esac
 exit $RETVAL
-
diff --git a/salt-syndic b/salt-syndic
index 44a4a8d..a687e3d 100644
--- a/salt-syndic
+++ b/salt-syndic
@@ -6,21 +6,24 @@
 # LSB header
 
 ### BEGIN INIT INFO
-# Provides: salt-syndic
-# Required-Start: network
-# Short-Description: salt syndic master-minion passthrough daemon
-# Description: This is a daemon that controls the salt syndic
+# Provides:          salt-syndic
+# Required-Start:    $all
+# Required-Stop:     
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Salt syndic master-minion passthrough daemon
+# Description:       This is a the Salt syndic daemon that enables Salt master-minion
+#                    remote control passthrough.
 ### END INIT INFO
 
+
 # chkconfig header
 
-# chkconfig: 345 99 99 
-# description:  This is a daemon that controls the salt mininons
+# chkconfig: - 99 99 
+# description:  This is a the Salt syndic daemon that enables Salt master-minion remote control passthrough.
 #
 # processname: /usr/bin/salt-syndic
 
-# Sanity checks.
-[ -x /usr/bin/salt-syndic ] || exit 0
 
 DEBIAN_VERSION=/etc/debian_version
 SUSE_RELEASE=/etc/SuSE-release
@@ -33,27 +36,35 @@ else
     . /etc/rc.d/init.d/functions
 fi
 
+# Default values (can be overridden below)
+SALTSYNDIC=/usr/bin/salt-syndic
+PYTHON=/usr/bin/python
+SYNDIC_ARGS=""
+
+if [ -f /etc/default/salt ]; then
+    . /etc/default/salt
+fi
+
 SERVICE=salt-syndic
 PROCESS=salt-syndic
-CONFIG_ARGS=" "
 
 RETVAL=0
 
 start() {
     echo -n $"Starting salt-syndic daemon: "
     if [ -f $SUSE_RELEASE ]; then
-        startproc -f -p /var/run/$SERVICE.pid /usr/bin/salt-syndic -d $CONFIG_ARGS
+        startproc -f -p /var/run/$SERVICE.pid $SALTSYNDIC -d $SYNDIC_ARGS
         rc_status -v
     elif [ -e $DEBIAN_VERSION ]; then
         if [ -f $LOCKFILE ]; then
             echo -n "already started, lock file found" 
             RETVAL=1
-        elif /usr/bin/python /usr/bin/salt-syndic -d; then
+        elif $PYTHON $SALTSYNDIC -d $SYNDIC_ARGS >& /dev/null; then
             echo -n "OK"
             RETVAL=0
         fi
     else
-        daemon --check $SERVICE $PROCESS -d $CONFIG_ARGS
+        daemon --check $SERVICE $SALTSYNDIC -d $SYNDIC_ARGS
     fi
     RETVAL=$?
     echo
@@ -63,11 +74,11 @@ start() {
 stop() {
     echo -n $"Stopping salt-syndic daemon: "
     if [ -f $SUSE_RELEASE ]; then
-        killproc -TERM /usr/bin/salt-syndic
+        killproc -TERM $SALTSYNDIC
         rc_status -v
     elif [ -f $DEBIAN_VERSION ]; then
         # Added this since Debian's start-stop-daemon doesn't support spawned processes
-        if ps -ef | grep "/usr/bin/python /usr/bin/salt-syndic" | grep -v grep | awk '{print $2}' | xargs kill &> /dev/null; then
+        if ps -ef | grep "$PYTHON $SALTSYNDIC" | grep -v grep | awk '{print $2}' | xargs kill &> /dev/null; then
             echo -n "OK"
             RETVAL=0
         else
@@ -94,7 +105,7 @@ case "$1" in
     status)
         if [ -f $SUSE_RELEASE ]; then
             echo -n "Checking for service salt-syndic "
-            checkproc /usr/bin/salt-syndic
+            checkproc $SALTSYNDIC
             rc_status -v
         elif [ -f $DEBIAN_VERSION ]; then
             if [ -f $LOCKFILE ]; then
@@ -115,4 +126,3 @@ case "$1" in
         ;;
 esac
 exit $RETVAL
-
diff --git a/salt.spec b/salt.spec
index 61de73c..7480032 100644
--- a/salt.spec
+++ b/salt.spec
@@ -9,9 +9,13 @@
 
 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%{!?pythonpath: %global pythonpath %(%{__python} -c "import os, sys; print(os.pathsep.join(sys.path))")}
+
+%define _salttesting SaltTesting
+%define _salttesting_ver 0.5.1
 
 Name: salt
-Version: 0.16.4
+Version: 0.17.0
 Release: 1%{?dist}
 Summary: A parallel remote execution system
 
@@ -19,13 +23,14 @@ Group:   System Environment/Daemons
 License: ASL 2.0
 URL:     http://saltstack.org/
 Source0: http://pypi.python.org/packages/source/s/%{name}/%{name}-%{version}.tar.gz
-Source1: %{name}-master
-Source2: %{name}-syndic
-Source3: %{name}-minion
-Source4: %{name}-master.service
-Source5: %{name}-syndic.service
-Source6: %{name}-minion.service
-Source7: README.fedora
+Source1: https://pypi.python.org/packages/source/S/%{_salttesting}/%{_salttesting}-%{_salttesting_ver}.tar.gz
+Source2: %{name}-master
+Source3: %{name}-syndic
+Source4: %{name}-minion
+Source5: %{name}-master.service
+Source6: %{name}-syndic.service
+Source7: %{name}-minion.service
+Source8: README.fedora
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -37,22 +42,24 @@ Requires: dmidecode
 
 Requires: pciutils
 Requires: yum-utils
+Requires: sshpass
 
 %if 0%{?with_python26}
-BuildRequires: python26-zmq
 BuildRequires: python26-crypto
 BuildRequires: python26-devel
-BuildRequires: python26-PyYAML
+BuildRequires: python26-jinja2
 BuildRequires: python26-m2crypto
 BuildRequires: python26-msgpack
-BuildRequires: python26-jinja2
+BuildRequires: python26-pip
+BuildRequires: python26-zmq
+BuildRequires: python26-PyYAML
 
 Requires: python26-crypto
-Requires: python26-zmq
 Requires: python26-jinja2
-Requires: python26-PyYAML
 Requires: python26-m2crypto
 Requires: python26-msgpack
+Requires: python26-PyYAML
+Requires: python26-zmq
 
 %else
 
@@ -65,15 +72,14 @@ BuildRequires: python-mock
 BuildRequires: git
 %endif
 
-BuildRequires: python-zmq
+BuildRequires: m2crypto
 BuildRequires: python-crypto
 BuildRequires: python-devel
-BuildRequires: PyYAML
-BuildRequires: m2crypto
-BuildRequires: python-msgpack
-
-
 BuildRequires: python-jinja2
+BuildRequires: python-msgpack
+BuildRequires: python-pip
+BuildRequires: python-zmq
+BuildRequires: PyYAML
 
 Requires: python-crypto
 Requires: python-zmq
@@ -130,28 +136,30 @@ Requires: salt = %{version}-%{release}
 Salt minion is queried and controlled from the master.
 
 %prep
-%setup -q
+%setup -c
+%setup -T -D -a 1
 
 %build
 
 
 %install
 rm -rf $RPM_BUILD_ROOT
+cd $RPM_BUILD_DIR/%{name}-%{version}/%{name}-%{version}
 %{__python} setup.py install -O1 --root $RPM_BUILD_ROOT
 
 %if ! (0%{?rhel} >= 7 || 0%{?fedora} >= 15)
 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
-install -p %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/
 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/
 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_initrddir}/
+install -p %{SOURCE4} $RPM_BUILD_ROOT%{_initrddir}/
 %else
 mkdir -p $RPM_BUILD_ROOT%{_unitdir}
-install -p -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_unitdir}/
 install -p -m 0644 %{SOURCE5} $RPM_BUILD_ROOT%{_unitdir}/
 install -p -m 0644 %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}/
+install -p -m 0644 %{SOURCE7} $RPM_BUILD_ROOT%{_unitdir}/
 %endif
 
-install -p %{SOURCE7} .
+install -p %{SOURCE8} .
 
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/salt/
 install -p -m 0640 conf/minion $RPM_BUILD_ROOT%{_sysconfdir}/salt/minion
@@ -159,7 +167,8 @@ install -p -m 0640 conf/master $RPM_BUILD_ROOT%{_sysconfdir}/salt/master
 
 %if ((0%{?rhel} >= 6 || 0%{?fedora} > 12) && 0%{?include_tests})
 %check
-%{__python} setup.py test --runtests-opts=-u
+cd $RPM_BUILD_DIR/%{name}-%{version}/%{name}-%{version}
+PYTHONPATH=%{pythonpath}:$RPM_BUILD_DIR/%{name}-%{version}/%{_salttesting}-%{_salttesting_ver} %{__python} setup.py test --runtests-opts=-u
 %endif
 
 %clean
@@ -167,11 +176,11 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
-%doc LICENSE
+%doc $RPM_BUILD_DIR/%{name}-%{version}/%{name}-%{version}/LICENSE
 %{python_sitelib}/%{name}/*
 %{python_sitelib}/%{name}-%{version}-py?.?.egg-info
 %doc %{_mandir}/man7/salt.7.*
-%doc README.fedora
+%doc $RPM_BUILD_DIR/%{name}-%{version}/%{name}-%{version}/README.fedora
 
 %files -n salt-minion
 %defattr(-,root,root)
@@ -190,18 +199,20 @@ rm -rf $RPM_BUILD_ROOT
 
 %files -n salt-master
 %defattr(-,root,root)
-%doc %{_mandir}/man1/salt-master.1.*
 %doc %{_mandir}/man1/salt.1.*
 %doc %{_mandir}/man1/salt-cp.1.*
 %doc %{_mandir}/man1/salt-key.1.*
+%doc %{_mandir}/man1/salt-master.1.*
 %doc %{_mandir}/man1/salt-run.1.*
+%doc %{_mandir}/man1/salt-ssh.1.*
 %doc %{_mandir}/man1/salt-syndic.1.*
 %{_bindir}/salt
-%{_bindir}/salt-master
-%{_bindir}/salt-syndic
 %{_bindir}/salt-cp
 %{_bindir}/salt-key
+%{_bindir}/salt-master
 %{_bindir}/salt-run
+%{_bindir}/salt-ssh
+%{_bindir}/salt-syndic
 %if ! (0%{?rhel} >= 7 || 0%{?fedora} >= 15)
 %attr(0755, root, root) %{_initrddir}/salt-master
 %attr(0755, root, root) %{_initrddir}/salt-syndic
@@ -244,8 +255,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %postun -n salt-minion
   if [ "$1" -ge "1" ] ; then
-      /sbin/service salt-master condrestart >/dev/null 2>&1 || :
-      /sbin/service salt-syndic condrestart >/dev/null 2>&1 || :
+      /sbin/service salt-minion condrestart >/dev/null 2>&1 || :
   fi
 
 %else
@@ -270,8 +280,8 @@ rm -rf $RPM_BUILD_ROOT
 %else
   if [ $1 -eq 0 ] ; then
       # Package removal, not upgrade
-      /bin/systemctl --no-reload disable salt-master.service > /dev/null 2>&1 || :
-      /bin/systemctl stop salt-master.service > /dev/null 2>&1 || :
+      /bin/systemctl --no-reload disable salt-minion.service > /dev/null 2>&1 || :
+      /bin/systemctl stop salt-minion.service > /dev/null 2>&1 || :
   fi
 %endif
 
@@ -303,16 +313,24 @@ rm -rf $RPM_BUILD_ROOT
   %systemd_postun salt-minion.service
 %else
   /bin/systemctl daemon-reload &>/dev/null
-  [ $1 -gt 0 ] && /bin/systemctl try-restart salt-master.service &>/dev/null || :
-  [ $1 -gt 0 ] && /bin/systemctl try-restart salt-syndic.service &>/dev/null || :
+  [ $1 -gt 0 ] && /bin/systemctl try-restart salt-minion.service &>/dev/null || :
 %endif
 
 %endif
 
 %changelog
-* Sun Sep 08 2013 Erik Johnson <erik at saltstack.com> - 0.16.4-1
+* Mon Sep 30 2013 Erik Johnson <erik at saltstack.com> - 0.17.0-1
+- Update to feature release 0.17.0
+
+* Wed Sep 11 2013 David Anderson <dave at dubkat.com>
+- Change sourcing order of init functions and salt default file
+
+* Sat Sep 07 2013 Erik Johnson <erik at saltstack.com> - 0.16.4-1
 - Update to patch release 0.16.4
 
+* Sun Aug 25 2013 Florian La Roche <Florian.LaRoche at gmx.net>
+- fixed preun/postun scripts for salt-minion
+
 * Thu Aug 15 2013 Andrew Niemantsverdriet <andrewniemants at gmail.com> - 0.16.3-1
 - Update to patch release 0.16.3
 
diff --git a/sources b/sources
index 09bb1ea..bbc21c8 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
-477df8b8efb336092b7dc60f505450a7  salt-0.16.4.tar.gz
+f4a6a5d590a2855b89060682117fb69e  SaltTesting-0.5.1.tar.gz
+c51dc289d7d7c49e6ebd74519f116441  salt-0.17.0.tar.gz


More information about the scm-commits mailing list