Update for Salt 2016.11.4

e9
David Murphy 8 years ago
parent 9618e807a7
commit 7e81b3f2db

1
.gitignore vendored

@ -69,3 +69,4 @@
/salt-2016.3.5.tar.gz
/salt-2016.11.2.tar.gz
/salt-2016.11.3.tar.gz
/salt-2016.11.4.tar.gz

Binary file not shown.

@ -99,7 +99,7 @@ stop() {
RETVAL=1
fi
else
killproc $PROCESS
killproc -d 10 $PROCESS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$SERVICE

@ -89,7 +89,7 @@ stop() {
RETVAL=1
fi
else
killproc $PROCESS
killproc -d 10 $PROCESS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$SERVICE

@ -246,7 +246,7 @@ main() {
fi
# Check to see if --notrim is a valid netstat option
if netstat --notrim 2>&1 >/dev/null | grep -q 'unrecognized'; then
if netstat --notrim -n 2>&1 >/dev/null | grep -q 'unrecognized'; then
NS_NOTRIM=''
fi

@ -90,7 +90,7 @@ stop() {
RETVAL=1
fi
else
killproc $PROCESS
killproc -d 10 $PROCESS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$SERVICE

@ -8,7 +8,6 @@
# TODO: --compound[tab] -- how?
# TODO: use history to extract some words, esp. if ${cur} is empty
# TODO: TEST EVERYTHING a lot
# TODO: cache results of some functions? where? how long?
# TODO: is it ok to use '--timeout 2' ?
@ -16,7 +15,7 @@ _salt_get_grains(){
if [ "$1" = 'local' ] ; then
salt-call --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g'
else
salt '*' --timeout 2 --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g'
salt '*' --timeout 2 --hide-timeout --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g'
fi
}
@ -24,12 +23,25 @@ _salt_get_grain_values(){
if [ "$1" = 'local' ] ; then
salt-call --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$'
else
salt '*' --timeout 2 --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$'
salt '*' --timeout 2 --hide-timeout --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$'
fi
}
_salt_get_keys(){
for type in $*; do
# remove header from data:
salt-key --no-color -l $type | tail -n+2
done
}
_salt(){
local _salt_cache_functions=${SALT_COMP_CACHE_FUNCTIONS:='~/.cache/salt-comp-cache_functions'}
local _salt_cache_timeout=${SALT_COMP_CACHE_TIMEOUT:='last hour'}
if [ ! -d "$(dirname ${_salt_cache_functions})" ]; then
mkdir -p "$(dirname ${_salt_cache_functions})"
fi
local cur prev opts _salt_grains _salt_coms pprev ppprev
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
@ -86,11 +98,11 @@ _salt(){
return 0
;;
salt)
COMPREPLY=($(compgen -W "\'*\' ${opts} `salt-key --no-color -l acc`" -- ${cur}))
COMPREPLY=($(compgen -W "\'*\' ${opts} $(_salt_get_keys acc)" -- ${cur}))
return 0
;;
-E|--pcre)
COMPREPLY=($(compgen -W "`salt-key --no-color -l acc`" -- ${cur}))
COMPREPLY=($(compgen -W "$(_salt_get_keys acc)" -- ${cur}))
return 0
;;
-G|--grain|--grain-pcre)
@ -116,7 +128,23 @@ _salt(){
;;
esac
_salt_coms="$(salt '*' --timeout 2 --out=txt -- sys.list_functions | sed 's/^.*\[//' | tr -d ",']" )"
# Regenerate cache if timed out
if [[ "$(stat --format=%Z ${_salt_cache_functions} 2>/dev/null)" -lt "$(date --date="${_salt_cache_timeout}" +%s)" ]]; then
# salt: get all functions on all minions
# sed: remove all array overhead and convert to newline separated list
# sort: chop out doubled entries, so overhead is minimal later during actual completion
salt '*' --timeout 2 --hide-timeout --out=txt -- sys.list_functions \
| sed "s/^.*\[//;s/[],']//g;s/ /\n/g" \
| sort -u \
> "${_salt_cache_functions}"
fi
# filter results, to only print the part to next dot (or end of function)
_salt_coms="$(sed 's/^\('${cur}'\(\.\|[^.]*\)\)\?.*/\1/' "${_salt_cache_functions}" | sort -u)"
# If there are still dots in the suggestion, do not append space
grep "^${cur}.*\." "${_salt_cache_functions}" &>/dev/null && compopt -o nospace
all="${opts} ${_salt_coms}"
COMPREPLY=( $(compgen -W "${all}" -- ${cur}) )
@ -158,15 +186,15 @@ _saltkey(){
case "${prev}" in
-a|--accept)
COMPREPLY=($(compgen -W "$(salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur}))
COMPREPLY=($(compgen -W "$(_salt_get_keys un rej)" -- ${cur}))
return 0
;;
-r|--reject)
COMPREPLY=($(compgen -W "$(salt-key -l acc --no-color)" -- ${cur}))
COMPREPLY=($(compgen -W "$(_salt_get_keys acc)" -- ${cur}))
return 0
;;
-d|--delete)
COMPREPLY=($(compgen -W "$(salt-key -l acc --no-color; salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur}))
COMPREPLY=($(compgen -W "$(_salt_get_keys acc un rej)" -- ${cur}))
return 0
;;
-c|--config)
@ -185,7 +213,7 @@ _saltkey(){
return 0
;;
-p|--print)
COMPREPLY=($(compgen -W "$(salt-key -l acc --no-color; salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur}))
COMPREPLY=($(compgen -W "$(_salt_get_keys acc un rej)" -- ${cur}))
return 0
;;
-l|--list)
@ -280,7 +308,7 @@ _saltcp(){
case ${prev} in
salt-cp)
COMPREPLY=($(compgen -W "${opts} `salt-key -l acc --no-color`" -- ${cur}))
COMPREPLY=($(compgen -W "${opts} $(_salt_get_keys acc)" -- ${cur}))
return 0
;;
-t|--timeout)
@ -289,7 +317,7 @@ _saltcp(){
return 0
;;
-E|--pcre)
COMPREPLY=($(compgen -W "`salt-key -l acc --no-color`" -- ${cur}))
COMPREPLY=($(compgen -W "$(_salt_get_keys acc)" -- ${cur}))
return 0
;;
-L|--list)
@ -297,7 +325,7 @@ _saltcp(){
prefpart="${cur%,*},"
postpart=${cur##*,}
filt="^\($(echo ${cur}| sed 's:,:\\|:g')\)$"
helper=($(salt-key -l acc --no-color | grep -v "${filt}" | sed "s/^/${prefpart}/"))
helper=($(_salt_get_keys acc | grep -v "${filt}" | sed "s/^/${prefpart}/"))
COMPREPLY=($(compgen -W "${helper[*]}" -- ${cur}))
return 0

@ -29,14 +29,17 @@
%global include_tests 0
# Release Candidate
%define __rc_ver %{nil}
%define fish_dir %{_datadir}/fish/vendor_functions.d
%define _salttesting SaltTesting
%define _salttesting_ver 2016.10.26
Name: salt
Version: 2016.11.3
Release: 1%{?dist}
Version: 2016.11.4
Release: 2%{?dist}
Summary: A parallel remote execution system
Group: System Environment/Daemons
@ -451,27 +454,40 @@ rm -rf %{buildroot}
/sbin/chkconfig --del salt-minion
fi
%preun api
if [ $1 -eq 0 ] ; then
/sbin/service salt-api stop >/dev/null 2>&1
/sbin/chkconfig --del salt-api
fi
%post master
/sbin/chkconfig --add salt-master
%post minion
/sbin/chkconfig --add salt-minion
## auto enable of salt-syndic and salt-api on startup not implemented
%postun master
if [ "$1" -ge "1" ] ; then
/sbin/service salt-master condrestart >/dev/null 2>&1 || :
fi
#%%postun syndic
# if [ "$1" -ge "1" ] ; then
# /sbin/service salt-syndic condrestart >/dev/null 2>&1 || :
# fi
%postun syndic
if [ "$1" -ge "1" ] ; then
/sbin/service salt-syndic condrestart >/dev/null 2>&1 || :
fi
%postun minion
if [ "$1" -ge "1" ] ; then
/sbin/service salt-minion condrestart >/dev/null 2>&1 || :
fi
%postun api
if [ "$1" -ge "1" ] ; then
/sbin/service salt-api condrestart >/dev/null 2>&1 || :
fi
%else
%preun master
@ -507,6 +523,17 @@ rm -rf %{buildroot}
fi
%endif
%preun api
%if 0%{?systemd_preun:1}
%systemd_preun salt-api.service
%else
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable salt-api.service > /dev/null 2>&1 || :
/bin/systemctl stop salt-api.service > /dev/null 2>&1 || :
fi
%endif
%post master
%if 0%{?systemd_post:1}
if [ $1 -gt 1 ] ; then
@ -518,6 +545,17 @@ rm -rf %{buildroot}
/bin/systemctl daemon-reload &>/dev/null || :
%endif
%post syndic
%if 0%{?systemd_post:1}
if [ $1 -gt 1 ] ; then
/usr/bin/systemctl try-restart salt-syndic.service >/dev/null 2>&1 || :
else
%systemd_post salt-syndic.service
fi
%else
/bin/systemctl daemon-reload &>/dev/null || :
%endif
%post minion
%if 0%{?systemd_post:1}
if [ $1 -gt 1 ] ; then
@ -529,6 +567,17 @@ rm -rf %{buildroot}
/bin/systemctl daemon-reload &>/dev/null || :
%endif
%post api
%if 0%{?systemd_post:1}
if [ $1 -gt 1 ] ; then
/usr/bin/systemctl try-restart salt-api.service >/dev/null 2>&1 || :
else
%systemd_post salt-api.service
fi
%else
/bin/systemctl daemon-reload &>/dev/null || :
%endif
%postun master
%if 0%{?systemd_post:1}
%systemd_postun_with_restart salt-master.service
@ -553,15 +602,28 @@ rm -rf %{buildroot}
[ $1 -gt 0 ] && /bin/systemctl try-restart salt-minion.service &>/dev/null || :
%endif
%postun api
%if 0%{?systemd_post:1}
%systemd_postun_with_restart salt-api.service
%else
/bin/systemctl daemon-reload &>/dev/null
[ $1 -gt 0 ] && /bin/systemctl try-restart salt-api.service &>/dev/null || :
%endif
%endif
%changelog
* Thu Apr 20 2017 SaltStack Packaging Team <packaging@saltstack.com> - 2016.11.4-2
- Use python-crypto on fedora platforms till pycryptodomex becomes available
* Wed Apr 19 2017 SaltStack Packaging Team <packaging@saltstack.com> - 2016.11.4-1
- Update to feature release 2016.11.4 and use of pycryptodomex
* Mon Mar 20 2017 SaltStack Packaging Team <packaging@saltstack.com> - 2016.11.3-2
- Updated to allow for pre and post processing for salt-syndic and salt-api
* Wed Feb 22 2017 SaltStack Packaging Team <packaging@saltstack.com> - 2016.11.3-1
- Update to feature release 2016.11.3
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2016.11.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Jan 17 2017 SaltStack Packaging Team <packaging@saltstack.com> - 2016.11.2-1
- Update to feature release 2016.11.2

@ -1,2 +1,2 @@
SHA512 (salt-2016.11.3.tar.gz) = 24bc75c50b4d6bd38a6f2dedc0a8c12142cc1b9d551455e49ea0ede405c78eb6a939f741dd8c0cbb8f206937ee69582bebe2fc127a24a4c2cf06cf3c3c16e507
SHA512 (SaltTesting-2016.10.26.tar.gz) = 0817d3738992bb1e89728a9cd939056bc919de9c995445aac8820f895204e0f14df4cff989c46456b382180e3a1685827a113dbb609518e88c6b944f9222698a
SHA512 (salt-2016.11.4.tar.gz) = ba928b61766d34774ce2e623fa79a46f6d373295c55b336e1b451e6a4afb0d547d78ceb9e466b64d8ba8bdbf2e750cbb77d008bc76308602729ae08241b8d346

Loading…
Cancel
Save