From ff4381f9cde75569fd392de17acca8ddf3ab0ac3 Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Tue, 31 Jan 2017 11:29:03 -0700 Subject: [PATCH] Upsate for Salt 2016.3.5 --- .gitignore | 1 + README.fedora | 7 +- salt-api | 4 +- salt-call.fish | 23 --- salt-cp.fish | 5 - salt-key.fish | 36 ---- salt-master.fish | 6 - salt-minion.fish | 6 - salt-run.fish | 6 - salt-syndic.fish | 6 - salt.fish | 38 ---- salt.spec | 142 ++++----------- salt_common.fish | 439 ----------------------------------------------- sources | 2 +- 14 files changed, 45 insertions(+), 676 deletions(-) delete mode 100644 salt-call.fish delete mode 100644 salt-cp.fish delete mode 100644 salt-key.fish delete mode 100644 salt-master.fish delete mode 100644 salt-minion.fish delete mode 100644 salt-run.fish delete mode 100644 salt-syndic.fish delete mode 100644 salt.fish delete mode 100644 salt_common.fish diff --git a/.gitignore b/.gitignore index ffebd27..7cadca0 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ /salt-2016.3.4.tar.gz /salt-2016.11.0.tar.gz /salt-2016.11.1.tar.gz +/salt-2016.3.5.tar.gz diff --git a/README.fedora b/README.fedora index 210610f..276a232 100644 --- a/README.fedora +++ b/README.fedora @@ -1,12 +1,11 @@ These packages are *optional* dependencies for salt. By default, they are not included in the salt RPMs. Install any of these packages to enable the functionality within salt. -MySQL-python -libvirt-python +MySQL-python +libvirt-python python-mako pymongo python-redis / redis -GitPython -A semi-canonical list of the optional salt modules can be found at +A semi-canonical list of the optional salt modules can be found at https://github.com/saltstack/salt/blob/develop/doc/conf.py#L30 diff --git a/salt-api b/salt-api index 87067a1..dab2ef4 100644 --- a/salt-api +++ b/salt-api @@ -139,7 +139,7 @@ case "$1" in RETVAL=$? fi ;; - condrestart) + condrestart|try-restart) [ -f $LOCKFILE ] && restart || : ;; reload) @@ -147,7 +147,7 @@ case "$1" in RETVAL=1 ;; *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload}" exit 1 ;; esac diff --git a/salt-call.fish b/salt-call.fish deleted file mode 100644 index e8300c7..0000000 --- a/salt-call.fish +++ /dev/null @@ -1,23 +0,0 @@ -# salt-call completion for fish shell -# See salt_common.fish in the same folder for the information - -# hack to load functions from salt_common completion -complete --do-complete='salt_common --' >/dev/null - -# salt-call general options (from --help) -complete -c salt-call -r -l file-root -d "Set this directory as the base file root." -complete -c salt-call -f -s g -l grains -d "Return the information generated by the salt grains " -complete -c salt-call -f -l id -d "Specify the minion id to use. If this option is omitted, the id option from the minion config will be used." -complete -c salt-call -f -l local -d "Run salt-call locally, as if there was no master running." -complete -c salt-call -x -l master -d "Specify the master to use. The minion must be authenticated with the master. If this option is omitted, the master options from the minion config will be used. If multi masters are set up the first listed master that responds will be used." -complete -c salt-call -r -s m -l module-dirs -d "Specify an additional directory to pull modules from. Multiple directories can be provided by passing `-m /--module-dirs` multiple times." -complete -c salt-call -r -l pillar-root -d "Set this directory as the base pillar root." -complete -c salt-call -f -l refresh-grains-cache -d "Force a refresh of the grains cache" -complete -c salt-call -f -l retcode-passthrough -d "Exit with the salt call retcode and not the salt binary retcode" -complete -c salt-call -f -l skip-grains -d "Do not load grains." - -# functions -complete -c salt-call -f -a '(__fish_salt_list_function)' -# complete -c salt -f -n 'not __fish_salt_extract_function' -a '(__fish_salt_list_function)' -# arguments and name values -complete -c salt-call -f -n '__fish_salt_extract_function' -a '(__fish_salt_list_arg_name) (__fish_salt_list_arg_value)' diff --git a/salt-cp.fish b/salt-cp.fish deleted file mode 100644 index 41beb53..0000000 --- a/salt-cp.fish +++ /dev/null @@ -1,5 +0,0 @@ -# salt-cp completion for fish shell -# See salt_common.fish in the same folder for the information - -# hack to load functions from salt_common.fish completion -complete --do-complete='salt_common --' >/dev/null diff --git a/salt-key.fish b/salt-key.fish deleted file mode 100644 index dbdab5a..0000000 --- a/salt-key.fish +++ /dev/null @@ -1,36 +0,0 @@ -# salt-key completion for fish shell -# See salt_common.fish in the same folder for the information - -# hack to load functions from salt_common completion -complete --do-complete='salt_common --' >/dev/null - - -# salt-key general options (from --help) -complete -c salt-key -f -s A -l accept-all -d "Accept all pending keys" -complete -c salt-key -f -s a -l accept -d "Accept the specified public key (use --include-all to match rejected keys in addition to pending keys). Globs are supported." -complete -c salt-key -f -l auto-create -d "Auto-create a signing key-pair if it does not yet exist" -complete -c salt-key -f -s D -l delete-all -d "Delete all keys" -complete -c salt-key -f -s d -l delete -d "Delete the specified key. Globs are supported." -complete -c salt-key -f -s F -l finger-all -d "Print all keys' fingerprints" -complete -c salt-key -f -s f -l finger -d "Print the specified key's fingerprint" -complete -c salt-key -r -l gen-keys-dir -d "Set the directory to save the generated keypair, only works with \"gen_keys_dir\" option; default=." -complete -c salt-key -f -l gen-keys -d "Set a name to generate a keypair for use with salt" -complete -c salt-key -f -l gen-signature -d "Create a signature file of the masters public-key named master_pubkey_signature. The signature can be send to a minion in the masters auth-reply and enables the minion to verify the masters public-key cryptographically. This requires a new signing-key- pair which can be auto-created with the --auto-create parameter" -complete -c salt-key -f -l include-all -d "Include non-pending keys when accepting/rejecting" -complete -c salt-key -x -l keysize -d "Set the keysize for the generated key, only works with the \"--gen-keys\" option, the key size must be 2048 or higher, otherwise it will be rounded up to 2048; ; default=2048" -complete -c salt-key -f -s L -l list-all -d "List all public keys. (Deprecated: use \"--list all\")" -complete -c salt-key -x -s l -l list -d "List the public keys" -a "pre un unaccepted acc accepted rej rejected all" -complete -c salt-key -f -s P -l print-all -d "Print all public keys" -complete -c salt-key -f -s p -l print -d "Print the specified public key" -complete -c salt-key -r -l priv -d "The private-key file to create a signature with" -complete -c salt-key -r -l pub -d "The public-key file to create a signature for" -complete -c salt-key -f -s R -l reject-all -d "Reject all pending keys" -complete -c salt-key -f -s r -l reject -d "Reject the specified public key (use --include-all to match accepted keys in addition to pending keys). Globs are supported." -complete -c salt-key -r -l signature-path -d "The path where the signature file should be written" - -# minions -complete -c salt-key -f -n '__fish_contains_opt -s a accept; and not __fish_salt_extract_minion' -a '(__fish_salt_list_minion unaccepted) (__fish_salt_list_minion rejected)' -complete -c salt-key -f -n '__fish_contains_opt -s d delete; and not __fish_salt_extract_minion' -a '(__fish_salt_list_minion all)' -complete -c salt-key -f -n '__fish_contains_opt -s f finger; and not __fish_salt_extract_minion' -a '(__fish_salt_list_minion all)' -complete -c salt-key -f -n '__fish_contains_opt -s p print; and not __fish_salt_extract_minion' -a '(__fish_salt_list_minion all)' -complete -c salt-key -f -n '__fish_contains_opt -s r reject; and not __fish_salt_extract_minion' -a '(__fish_salt_list_minion unaccepted) (__fish_salt_list_minion accepted)' diff --git a/salt-master.fish b/salt-master.fish deleted file mode 100644 index 895b1ee..0000000 --- a/salt-master.fish +++ /dev/null @@ -1,6 +0,0 @@ -# salt-master completion for fish shell -# See salt_common.fish in the same folder for the information - -# hack to load functions from salt_common completion -complete --do-complete='salt_common --' >/dev/null - diff --git a/salt-minion.fish b/salt-minion.fish deleted file mode 100644 index 5d3a396..0000000 --- a/salt-minion.fish +++ /dev/null @@ -1,6 +0,0 @@ -# salt-minion completion for fish shell -# See salt_common.fish in the same folder for the information - -# hack to load functions from salt_common completion -complete --do-complete='salt_common --' >/dev/null - diff --git a/salt-run.fish b/salt-run.fish deleted file mode 100644 index f0e79a2..0000000 --- a/salt-run.fish +++ /dev/null @@ -1,6 +0,0 @@ -# salt-run completion for fish shell -# See salt_common.fish in the same folder for the information - -# hack to load functions from salt_common completion -complete --do-complete='salt_common --' >/dev/null - diff --git a/salt-syndic.fish b/salt-syndic.fish deleted file mode 100644 index 1698778..0000000 --- a/salt-syndic.fish +++ /dev/null @@ -1,6 +0,0 @@ -# salt completion for fish shell -# See salt_common.fish in the same folder for the information - -# hack to load functions from salt_common completion -complete --do-complete='salt_common --' >/dev/null - diff --git a/salt.fish b/salt.fish deleted file mode 100644 index 035f587..0000000 --- a/salt.fish +++ /dev/null @@ -1,38 +0,0 @@ -# salt completion for fish shell -# See salt_common.fish in the same folder for the information - -# hack to load functions from salt_common completion -complete --do-complete='salt_common --' >/dev/null - -# salt general options (from --help) -for auth in auth eauth external-auth - complete -c salt -f -s a -l $auth -d "Specify an external authentication system to use." -end -for batch in batch batch-size - complete -c salt -f -s b -l $batch -d "Execute the salt job in batch mode, pass either the number of minions to batch at a time, or the percentage of minions to have runnin" -end -complete -c salt -x -l args-separator -d "Set the special argument used as a delimiter between command arguments of compound commands. This is useful when one wants to pass commas as arguments to some of the commands in a compound command." -complete -c salt -f -l async -d "Run the salt command but don't wait for a reply" -complete -c salt -f -s C -l compound -d "The compound target option allows for multiple target types to be evaluated, allowing for greater granularity in target matching. The compound target is space delimited, targets other than globs are preceded with an identifier matching the specific targets argument type: salt \"G@os:RedHat and webser* or E@database.*\"" -complete -c salt -f -s S -l ipcidr -d "Match based on Subnet (CIDR notation) or IPv4 address." -complete -c salt -f -s T -l make-token -d "Generate and save an authentication token for re-use. The token is generated and made available for the period defined in the Salt Master." -complete -c salt -x -l password -d "Password for external authentication" -complete -c salt -f -s I -l pillar -d "Instead of using shell globs to evaluate the target use a pillar value to identify targets, the syntax for the target is the pillar key followed by a globexpression: \"role:production*\"" -complete -c salt -f -l show-timeout -d "Display minions that timeout without the additional output of --verbose" -complete -c salt -f -l show-jid -d "Display jid without the additional output of --verbose" -complete -c salt -x -l state-output -d "Override the configured state_output value for minion output. Default: full" -complete -c salt -f -s s -l static -d "Return the data from minions as a group after they all return." -complete -c salt -x -l subset -d "Execute the routine on a random subset of the targeted minions. The minions will be verified that they have the named function before executing" -complete -c salt -f -l summary -d "Display summary information about a salt command" -complete -c salt -x -l username -d "Username for external authentication" -complete -c salt -f -s v -l verbose -d "Turn on command verbosity, display jid and active job queries" - -# salt arguments -# minions -complete -c salt -f -n 'not __fish_salt_extract_minion' -a '(__fish_salt_list_minion accepted)' -d 'Minion' -# functions -complete -c salt -f -n '__fish_salt_extract_minion; and not __fish_salt_extract_function' -a '(__fish_salt_list_function)' -d 'Function' -# arguments names -complete -c salt -f -n '__fish_salt_extract_function' -a '(__fish_salt_list_arg_name)' -d 'Argument' -# arguments values -complete -c salt -f -n '__fish_salt_extract_function' -a '(__fish_salt_list_arg_value | __fish_salt_prefix_with_arg_name)' diff --git a/salt.spec b/salt.spec index d5941a1..bd40b44 100644 --- a/salt.spec +++ b/salt.spec @@ -1,19 +1,3 @@ -%if ( "0%{?dist}" == "0.amzn1" ) -%global with_explicit_python27 1 -%global pybasever 2.7 -%global __python_ver 27 -%global __python %{_bindir}/python%{?pybasever} -%global __python2 %{_bindir}/python%{?pybasever} - -%global python2_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -%global python2_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(x for x in sys.path if x))")} - -%global __inst_layout --install-layout=unix - -%else - %if ! (0%{?rhel} >= 6 || 0%{?fedora} > 12) %global with_python26 1 %define pybasever 2.6 @@ -21,21 +5,17 @@ %define __python %{_bindir}/python%{?pybasever} %endif -%{!?python2_sitelib: %global python2_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%{!?python2_sitearch: %global python2_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(x for x in sys.path if x))")} - -%endif - %global include_tests 0 -%define fish_dir %{_datadir}/fish/vendor_functions.d +%{!?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(x for x in sys.path if x))")} %define _salttesting SaltTesting %define _salttesting_ver 2016.10.26 Name: salt -Version: 2016.11.1 +Version: 2016.3.5 Release: 1%{?dist} Summary: A parallel remote execution system @@ -55,15 +35,6 @@ Source9: %{name}-api.service Source10: README.fedora Source11: %{name}-common.logrotate Source12: salt.bash -Source13: salt.fish -Source14: salt_common.fish -Source15: salt-call.fish -Source16: salt-cp.fish -Source17: salt-key.fish -Source18: salt-master.fish -Source19: salt-minion.fish -Source20: salt-run.fish -Source21: salt-syndic.fish ## Patch0: salt-%%{version}-tests.patch @@ -119,21 +90,17 @@ BuildRequires: python-argparse %endif -BuildRequires: python%{?__python_ver}-devel -Requires: python%{?__python_ver}-crypto >= 2.6.1 -Requires: python%{?__python_ver}-jinja2 -Requires: python%{?__python_ver}-msgpack > 0.3 -%if ( "0%{?dist}" == "0.amzn1" ) -Requires: python27-PyYAML -%else +BuildRequires: python-devel +Requires: python-crypto >= 2.6.1 +Requires: python-jinja2 +Requires: python-msgpack > 0.3 Requires: PyYAML -%endif -Requires: python%{?__python_ver}-requests >= 1.0.0 -Requires: python%{?__python_ver}-zmq -Requires: python%{?__python_ver}-markupsafe -Requires: python%{?__python_ver}-tornado >= 4.2.1 -Requires: python%{?__python_ver}-futures >= 2.0 -Requires: python%{?__python_ver}-six +Requires: python-requests >= 1.0.0 +Requires: python-zmq +Requires: python-markupsafe +Requires: python-tornado >= 4.2.1 +Requires: python-futures >= 2.0 +Requires: python-six %endif @@ -205,7 +172,7 @@ Requires: %{name}-master = %{version}-%{release} %if 0%{?with_python26} Requires: python26-cherrypy %else -Requires: python%{?__python_ver}-cherrypy +Requires: python-cherrypy %endif @@ -219,7 +186,7 @@ Requires: %{name}-master = %{version}-%{release} %if 0%{?with_python26} Requires: python26-libcloud %else -Requires: python%{?__python_ver}-libcloud +Requires: python-libcloud %endif %description cloud @@ -248,7 +215,7 @@ cd %{name}-%{version} %install rm -rf %{buildroot} cd $RPM_BUILD_DIR/%{name}-%{version}/%{name}-%{version} -%{__python} setup.py install -O1 %{?__inst_layout } --root %{buildroot} +%{__python} setup.py install -O1 --root %{buildroot} # Add some directories install -d -m 0755 %{buildroot}%{_var}/log/salt @@ -266,7 +233,6 @@ install -d -m 0755 %{buildroot}%{_sysconfdir}/salt/cloud.deploy.d install -d -m 0755 %{buildroot}%{_sysconfdir}/salt/cloud.maps.d install -d -m 0755 %{buildroot}%{_sysconfdir}/salt/cloud.profiles.d install -d -m 0755 %{buildroot}%{_sysconfdir}/salt/cloud.providers.d -install -d -m 0755 %{buildroot}%{_sysconfdir}/salt/proxy.d # Add the config files install -p -m 0640 conf/minion %{buildroot}%{_sysconfdir}/salt/minion @@ -307,18 +273,6 @@ install -p -m 0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/logrotate.d/salt mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ install -p -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/bash_completion.d/salt.bash -# Fish completion (TBD remove -v) -mkdir -p %{buildroot}%{fish_dir} -install -p -m 0644 %{SOURCE13} %{buildroot}%{fish_dir}/salt.fish -install -p -m 0644 %{SOURCE14} %{buildroot}%{fish_dir}/salt_common.fish -install -p -m 0644 %{SOURCE15} %{buildroot}%{fish_dir}/salt-call.fish -install -p -m 0644 %{SOURCE16} %{buildroot}%{fish_dir}/salt-cp.fish -install -p -m 0644 %{SOURCE17} %{buildroot}%{fish_dir}/salt-key.fish -install -p -m 0644 %{SOURCE18} %{buildroot}%{fish_dir}/salt-master.fish -install -p -m 0644 %{SOURCE19} %{buildroot}%{fish_dir}/salt-minion.fish -install -p -m 0644 %{SOURCE20} %{buildroot}%{fish_dir}/salt-run.fish -install -p -m 0644 %{SOURCE21} %{buildroot}%{fish_dir}/salt-syndic.fish - %if ((0%{?rhel} >= 6 || 0%{?fedora} > 12) && 0%{?include_tests}) %check cd $RPM_BUILD_DIR/%{name}-%{version}/%{name}-%{version} @@ -332,35 +286,27 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc $RPM_BUILD_DIR/%{name}-%{version}/%{name}-%{version}/LICENSE -%{python2_sitelib}/%{name}/* -#%%{python2_sitelib}/%%{name}-%%{version}-py?.?.egg-info - -%if ( "0%{?dist}" == "0.amzn1" ) -%{python2_sitelib}/%{name}-%{version}.egg-info -%else -%{python2_sitelib}/%{name}-*-py?.?.egg-info -%endif - +%{python_sitelib}/%{name}/* +#%%{python_sitelib}/%%{name}-%%{version}-py?.?.egg-info +%{python_sitelib}/%{name}-*-py?.?.egg-info %{_sysconfdir}/logrotate.d/salt %{_sysconfdir}/bash_completion.d/salt.bash %{_var}/cache/salt %{_var}/log/salt %doc $RPM_BUILD_DIR/%{name}-%{version}/%{name}-%{version}/README.fedora %{_bindir}/spm -%doc %{_mandir}/man1/spm.1* +%doc %{_mandir}/man1/spm.1.* %config(noreplace) %{_sysconfdir}/salt/ %config(noreplace) %{_sysconfdir}/salt/pki -%config(noreplace) %{fish_dir}/salt*.fish %files master %defattr(-,root,root) -%doc %{_mandir}/man7/salt.7* -%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-unity.1* +%doc %{_mandir}/man7/salt.7.* +%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-unity.1.* %{_bindir}/salt %{_bindir}/salt-cp %{_bindir}/salt-key @@ -379,9 +325,9 @@ rm -rf %{buildroot} %files minion %defattr(-,root,root) -%doc %{_mandir}/man1/salt-call.1* -%doc %{_mandir}/man1/salt-minion.1* -%doc %{_mandir}/man1/salt-proxy.1* +%doc %{_mandir}/man1/salt-call.1.* +%doc %{_mandir}/man1/salt-minion.1.* +%doc %{_mandir}/man1/salt-proxy.1.* %{_bindir}/salt-minion %{_bindir}/salt-call %{_bindir}/salt-proxy @@ -397,7 +343,7 @@ rm -rf %{buildroot} %config(noreplace) %{_var}/log/salt/minion %files syndic -%doc %{_mandir}/man1/salt-syndic.1* +%doc %{_mandir}/man1/salt-syndic.1.* %{_bindir}/salt-syndic %if ! (0%{?rhel} >= 7 || 0%{?fedora} >= 15) %attr(0755, root, root) %{_initrddir}/salt-syndic @@ -407,7 +353,7 @@ rm -rf %{buildroot} %files api %defattr(-,root,root) -%doc %{_mandir}/man1/salt-api.1* +%doc %{_mandir}/man1/salt-api.1.* %{_bindir}/salt-api %if ! (0%{?rhel} >= 7 || 0%{?fedora} >= 15) %attr(0755, root, root) %{_initrddir}/salt-api @@ -416,7 +362,7 @@ rm -rf %{buildroot} %endif %files cloud -%doc %{_mandir}/man1/salt-cloud.1* +%doc %{_mandir}/man1/salt-cloud.1.* %{_bindir}/salt-cloud %{_sysconfdir}/salt/cloud.conf.d %{_sysconfdir}/salt/cloud.deploy.d @@ -426,7 +372,7 @@ rm -rf %{buildroot} %config(noreplace) %{_sysconfdir}/salt/cloud %files ssh -%doc %{_mandir}/man1/salt-ssh.1* +%doc %{_mandir}/man1/salt-ssh.1.* %{_bindir}/salt-ssh %config(noreplace) %{_sysconfdir}/salt/roster @@ -558,23 +504,11 @@ rm -rf %{buildroot} %endif %changelog -* Tue Dec 13 2016 SaltStack Packaging Team - 2016.11.1-1 -- Update to feature release 2016.11.1 - -* Wed Nov 30 2016 SaltStack Packaging Team - 2016.11.0-2 -- Adjust for single spec for Redhat family and fish-completions - -* Tue Nov 22 2016 SaltStack Packaging Team - 2016.11.0-1 -- Update to feature release 2016.11.0 - -* Wed Nov 2 2016 SaltStack Packaging Team - 2016.11.0-0.rc2 -- Update to feature release 2016.11.0 Release Candidate 2 - -* Wed Oct 26 2016 SaltStack Packaging Team - 2016.11.0-0.rc1 -- Update to feature release 2016.11.0 Release Candidate 1 +* Tue Jan 17 2017 SaltStack Packaging Team - 2016.3.5-1 +- Update to feature release 2016.3.5 -* Fri Oct 14 2016 SaltStack Packaging Team - 2016.3.3-4 -- Ported to build on Amazon Linux 2016.09 natively +* Mon Oct 31 2016 SaltStack Packaging Team - 2016.3.4-1 +- Update to feature release 2016.3.4 * Mon Sep 12 2016 SaltStack Packaging Team - 2016.3.3-3 - Adjust spec file for Fedora 24 support diff --git a/salt_common.fish b/salt_common.fish deleted file mode 100644 index ad5b04d..0000000 --- a/salt_common.fish +++ /dev/null @@ -1,439 +0,0 @@ -# salt-call completion for fish shell -# This file contains common options and helper functions. - -# README: -# Completion lines are structured as a table to make it easier edit them with -# vim or similar editors. Long lines (that are longer than the completion line -# until "-d 'help message'") are splitted. Descriptions are not splitted. -# TAB width is set to 4 chars! -# Completion lines are sorted by groups, in groups they are sorted by long -# option name (by alphabet). -# If you want to add some completions for arguments value you probably want to -# add line into __fish_salt_args_types variable. First column is the name of -# argument (_ is for unnamed arguments), second is the name of the function, -# last one is the type of the completion (you can use any types that have -# corresponding function __fish_salt_list_TYPE). -# -# VERSION: -# Generated from the help of salt programs on commit ad89a752f807d5ea00d3a9b3257d283ef6b69c10 -# -# ISSUES: -# TODO: #1 add: salt-api salt-cloud salt-ssh -# TODO: #2 write tests (use https://github.com/terlar/fish-tank) -# TODO: #3 add completion for builtin states -# TODO: #4 use caching (see https://github.com/saltstack/salt/issues/15321) -# TODO: #5 add help to the positional arguments (like '(Minion)', '(Grain)') -# using __fish_salt_list function everythere) -# TODO: #6 add minion selection by grains (call "salt '*' grains.ls", use #4) -# BUG: #7 salt-call autocompletion and salt packages not works; it hangs. Ask -# fish devs? -# TODO: #8 sort with `sort` or leave as is? - -# common general options (from --help) -set -l salt_programs \ -salt salt-call salt-cp salt-key salt-master salt-minion \ -salt-run salt-syndic -for program in $salt_programs - complete -c $program -f -l version -d "show program's version number and exit" - complete -c $program -f -l versions-report -d "show program's dependencies version number and exit" - complete -c $program -f -s h -l help -d "show help message and exit" - complete -c $program -r -s c -l config-dir -d "Pass in an alternative configuration directory. Default: /etc/salt" - # BUG: (log file is different for different programs) - complete -c $program -r -l log-file -d "Log file path. Default: /var/log/salt/master." - complete -c $program -x -l log-file-level -d "Logfile logging log level. Default: \"warning\"." -a "all garbage trace debug info warning error critical quiet" - complete -c $program -x -s l -l log-level -d "logging log level. Default: \"warning\"." -a "all garbage trace debug info warning error critical quiet" -end -set -l salt_programs_crash salt salt-call salt-cp \ - salt-key salt-run -for program in $salt_programs_crash - complete -c $program -f -l hard-crash -d "Raise any original exception rather than exiting gracefully. Default: False" -end -set -l salt_programs_output_color salt salt-call \ - salt-key salt-run -for program in $salt_programs_output_color - for color in color colour - complete -c $program -f -l force-$color -d "Force colored output" - complete -c $program -f -l no-$color -d "Disable all colored output" - end -end -set -l salt_programs_output salt salt-call salt-key -for program in $salt_programs_output - for out in out output - complete -c $program -x -l $out -d "Print the output from the \"$program\" command using the specified outputter" -a "raw compact no_return grains overstatestage pprint json nested yaml highstate quiet key txt virt_query newline_values_only" - complete -c $program -r -l $out-file -d "Write the output to the specified file" - complete -c $program -x -l $out-file-append -d "Append the output to the specified file" - complete -c $program -x -l $out-indent -d "Print the output indented by the provided value in spaces. Negative values disables indentation. Only applicable in outputters that support indentation." - end -end -set -l salt_programs_doc salt salt-call salt-run -for program in $salt_programs_doc - for doc in doc documentation - complete -c $program -f -s d -l $doc -d "Display documentation for runners, pass a runner or runner.function to see documentation on only that runner or function." - end -end -set -l salt_programs_select salt salt-cp -for program in $salt_programs_select - complete -c $program -f -s G -l grain -d "Instead of using shell globs to evaluate the target use a grain value to identify targets, the syntax for the target is the grain key followed by a globexpression: \"os:Arch*\"" - complete -c $program -f -l grain-pcre -d "Instead of using shell globs to evaluate the target use a grain value to identify targets, the syntax for the target is the grain key followed by a pcre regular expression: \"os:Arch.*\"" - complete -c $program -f -s L -l list -d "Instead of using shell globs to evaluate the target servers, take a comma or space delimited list of servers." - complete -c $program -f -s N -l nodegroup -d "Instead of using shell globs to evaluate the target use one of the predefined nodegroups to identify a list of targets." - complete -c $program -f -s E -l pcre -d "Instead of using shell globs to evaluate the target servers, use pcre regular expressions" - complete -c $program -f -s R -l range -d "Instead of using shell globs to evaluate the target use a range expression to identify targets. Range expressions look like %cluster" -end -set -l salt_programs_user_daemon_pidfile \ -salt-master salt-minion salt-syndic -for program in $salt_programs_user_daemon_pidfile - complete -c $program -x -s u -l user -d "Specify user to run $program" - complete -c $program -f -s d -l daemon -d "Run the $program as a daemon" - complete -c $program -l pid-file -d "Specify the location of the pidfile. Default: /var/run/$program.pid." -end -function __fish_salt_default_timeout - echo (echo $argv[1] | sed ' - s/^salt$/5/g; - s/^salt-call$/60/g; - s/^salt-cp$/5/g; - s/^salt-run$/1/g - ') -end -set -l salt_programs_timeout salt salt-call salt-cp \ - salt-run -for program in $salt_programs_timeout - complete -c $program -x -s t -l timeout -d "Change the timeout, if applicable, for the running command; default="(__fish_salt_default_timeout $program) -end -set -l salt_programs_return salt salt-cp -for program in $salt_programs_return - complete -c $program -x -l return -d "Set an alternative return method. By default salt will send the return data from the command back to the master, but the return data can be redirected into any number of systems, databases or applications." -end - -# convinience functions -function __fish_salt_log - echo $argv >&2 -end - -function __fish_salt_join - # remove empty elements - set a (echo $argv[2..-1] | sed 's/ /\n/g' | grep -Ev '^$') - set delimiter $argv[1] - printf "$delimiter%s" $a | cut -c 2- -end - -function __fish_salt_clean_prefix - set prefix '^'$argv[1] - grep -E $prefix | sed "s/$prefix//g" -end - -function __fish_salt_clean - if [ $argv[1] = yaml ] - __fish_salt_clean_prefix ' *- ' - else if [ $argv[1] = nested ] - __fish_salt_clean_prefix ' *' - end -end - -set -g __fish_salt_max_line_count_in_yaml_block 1024 - -function __fish_salt_lines_between - set max $__fish_salt_max_line_count_in_yaml_block - grep -A$max $argv[1] | grep -B$max $argv[2] -end - -function __fish_salt_extract_first_yaml_block - set max $__fish_salt_max_line_count_in_yaml_block - sed '1d' | sed '$a\ stop' | grep -m 1 -B$max '^ \w' | sed '$d' -end - -function __fish_salt_add_help - sed "s/\$/\t$argv/" -end - -function __fish_salt_underscore_to_space - sed 's/^\w/\u&/g; s/_/ /g' -end - -# information extraction from commandline - -set -g __fish_salt_default_program 'salt' - -# BUG: Completion doesn't work with correct commandline like -# salt --out raw server test.ping -# Consider rewriting using __fish_complete_subcommand -function __fish_salt_program - if status --is-interactive - set result (commandline -pco) - if test -n "$result" - if [ $result[1] = 'salt-call' ]; and contains -- '--local' $result - set options '--local' - end - set result $result[1] $options - end - end - set result $__fish_salt_default_program - echo $result -end - -function __fish_salt_save_first_commandline_token_not_matching_args_to - if status --is-interactive - set -l cli (commandline -pco) - for i in $cli - if echo "$i" | grep -Ev (__fish_salt_join '|' $argv) - set -g $argv[1] $i - return 0 - end - end - end - return 1 -end - -function __fish_salt_commandline_tokens_not_matching_args - if status --is-interactive - set tokens (commandline -pco) - set result 1 - for token in $tokens - if echo "$token" | grep -Ev (__fish_salt_join '|' $argv) - set result 0 - end - end - end - return $result -end - -set __fish_salt_base_ignores (__fish_salt_join '|' $salt_programs '^-.*') - -function __fish_salt_ignores_minion - echo $__fish_salt_base_ignores -end - -function __fish_salt_extract_minion - __fish_salt_save_first_commandline_token_not_matching_args_to __fish_salt_extracted_minion (__fish_salt_ignores_minion) -end - -function __fish_salt_minion - __fish_salt_extract_minion > /dev/null - echo $__fish_salt_extracted_minion -end - -function __fish_salt_ignores_function - __fish_salt_join '|' $__fish_salt_base_ignores (__fish_salt_minion) -end - -function __fish_salt_extract_function - __fish_salt_save_first_commandline_token_not_matching_args_to __fish_salt_extracted_function (__fish_salt_ignores_function) -end - -function __fish_salt_function - __fish_salt_extract_function > /dev/null - echo $__fish_salt_extracted_function -end - -function __fish_salt_ignores_args - __fish_salt_join '|' (__fish_salt_ignores_function) (__fish_salt_function) -end - -function __fish_salt_args - __fish_salt_commandline_tokens_not_matching_args (__fish_salt_ignores_args) -end - -set __fish_salt_arg_name_re '\w*=' - -function __fish_salt_arg_name - set result (commandline -ct | grep -E --only-matching $__fish_salt_arg_name_re) - if test -z $result - set result '_=' - end - echo $result | sed 's/=$//g' -end - -function __fish_salt_arg_value - commandline -ct | sed "s/$__fish_salt_arg_name_re//g" -end - -function __fish_salt_arg_value_by_name - set arg_name "$argv=" - __fish_salt_args | __fish_salt_clean_prefix $arg_name -end - -# getting info from salt -set -g __fish_salt_format_options --no-color --log-level=quiet - -function __fish_salt_exec - set -l program (__fish_salt_program) - set -l exe $program $__fish_salt_format_options $__fish_salt_format_options_temp - if [ $program = salt ] - set exe $exe (__fish_salt_minion) - end - eval $exe $argv -end - -function __fish_salt_exec_output - set -g __fish_salt_format_options_temp "--output=$argv[1]" - __fish_salt_exec $argv[2..-1] - set -e __fish_salt_format_options_temp -end - -function __fish_salt_exec_and_clean - __fish_salt_exec_output $argv | __fish_salt_clean $argv[1] -end - -function __fish_salt_list - begin - for arg_type in $argv - set f_list '__fish_salt_list_'$arg_type - eval $f_list | __fish_salt_add_help (echo $arg_type | __fish_salt_underscore_to_space) - end - end -end - -set -g __fish_salt_args_types ' -_ cmd.retcode : minion_cmd -cmd cmd.retcode : minion_cmd -shell cmd.retcode : minion_file -_ cmd.run : minion_cmd -cmd cmd.run : minion_cmd -shell cmd.run : minion_file -_ cmd.run_all : minion_cmd -cmd cmd.run_all : minion_cmd -shell cmd.run_all : minion_file -_ cmd.run_stderr : minion_cmd -cmd cmd.run_stderr : minion_cmd -shell cmd.run_stderr : minion_file -_ cmd.run_stdout : minion_cmd -cmd cmd.run_stdout : minion_cmd -shell cmd.run_stdout : minion_file -shell cmd.script : minion_file -shell cmd.script_retcode : minion_file -_ cmd.which : minion_cmd -cmd cmd.which : minion_cmd -_ cp.get_dir : master_file -_ cp.get_dir : minion_file -path cp.get_dir : master_file -dest cp.get_dir : minion_file -_ cp.get_file : master_file -_ cp.get_file : minion_file -path cp.get_file : master_file -dest cp.get_file : minion_file -_ file.copy : minion_file -src file.copy : minion_file -dst file.copy : minion_file -_ grains.append : grain -key grains.append : grain -_ grains.delval : grain -key grains.delval : grain -_ grains.get : grain -key grains.get : grain -_ grains.get_or_set_hash : grain -name grains.get_or_set_hash : grain -_ grains.has_value : grain -key grains.has_value : grain -_ grains.item : grain -_ grains.items : grain -_ grains.remove : grain -key grains.remove : grain -_ grains.setval : grain -key grains.setval : grain -exclude state.highstate : state -_ state.sls : state -_ state.show_sls : state -_ state.sls : state -exclude state.sls : state -_ sys.argspec : function -_ sys.argspec : module -module sys.argspec : module -_ sys.doc : function -_ sys.doc : module -' -#_ pkg.remove : package - -function __fish_salt_argspec_function - set function_line '^\s*'$argv[1]: - set max $__fish_salt_max_line_count_in_yaml_block - grep -A$max $function_line | __fish_salt_extract_first_yaml_block -end - -function __fish_salt_argspec_args - __fish_salt_lines_between '^\s*args:' '^\s*defaults:' | grep -v ':' -end - -function __fish_salt_list_arg_name - __fish_salt_exec_output yaml sys.argspec (__fish_salt_function) | __fish_salt_argspec_function (__fish_salt_function) | __fish_salt_argspec_args | __fish_salt_clean yaml | sed 's/$/=/g' -end - -function __fish_salt_list_arg_value - set arg_path_re (__fish_salt_arg_name)'\s*'(__fish_salt_function)'\s*:\s*' - set arg_types (echo $__fish_salt_args_types | __fish_salt_clean_prefix $arg_path_re) - __fish_salt_list $arg_types -end - -function __fish_salt_list_function - __fish_salt_exec_and_clean yaml sys.list_functions $argv -end - -function __fish_salt_list_grain - __fish_salt_exec_and_clean yaml grains.ls $argv -end - -function __fish_salt_list_master_file_abs - __fish_salt_exec_and_clean yaml cp.list_master -end - -function __fish_salt_list_master_file - __fish_salt_list_master_file_abs | sed 's/^/salt:\/\//g' -end - -function __fish_salt_list_minion - salt-key --no-color --list=$argv[1] | grep -Ev '^(Accepted|Unaccepted|Rejected) Keys:$' -end - -function __fish_salt_list_minion_cmd - set cmd (__fish_salt_arg_value | sed 's/^[\'"]//') - set complete_cmd_exe '"complete --do-complete=\''$cmd'\'"' - set cmd_without_last_word (echo $cmd | sed -E 's/\S*$//') - # BUG: Static paths. Do we need to use which? - set bash_shell '/bin/bash' - set fish_shell '/usr/bin/fish' - set sh_shell '/bin/sh' - set zsh_shell '/usr/bin/zsh' - set shell (__fish_salt_arg_value_by_name shell); and test -z $shell; and set shell $sh_shell - switch $shell - case $fish_shell - __fish_salt_exec_and_clean nested cmd.run shell=$fish_shell cmd=$complete_cmd_exe | awk -v prefix="$cmd_without_last_word" '{print prefix $0}' - case $bash_shell $zsh_shell - # Not implemented; See - # https://github.com/fish-shell/fish-shell/issues/1679#issuecomment-55487388 - case $sh_shell - # sh doesn't have completions - end -end - -function __fish_salt_list_minion_file - if [ (count $argv) -eq 0 ] - set file (__fish_salt_arg_value) - else - set file $argv[1] - end - set exe '"ls --directory --file-type '$file'* 2> /dev/null"' - __fish_salt_exec_output nested cmd.run $exe | __fish_salt_clean nested -end - -function __fish_salt_list_module - __fish_salt_exec_and_clean yaml sys.list_modules $argv -end - -function __fish_salt_list_package - __fish_salt_exec_and_clean yaml pkg.list_pkgs $argv | sed 's/:.*//g' -end - -function __fish_salt_list_state - __fish_salt_list_master_file_abs | grep '.sls' | sed 's/\//./g;s/\.init\.sls/.sls/g;s/\.sls//g' -end - -function __fish_salt_prefix_with_arg_name - set arg_name (__fish_salt_arg_name) - if [ $arg_name != '_' ] - sed "p;s/^/$arg_name=/g" - else - # leave stdout as is; don't remove this line, because if construction - # clears stdout if condition fails - tee - end -end - diff --git a/sources b/sources index a7440ad..77f882b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ +SHA512 (salt-2016.3.5.tar.gz) = ca9ae85f8174aa55fefeaef70d65981d581f25f14f219f437ad4dc0db08e5944f356564c92aee46e796547db38312efedc8db5080576d578982f963a742635e6 SHA512 (SaltTesting-2016.10.26.tar.gz) = 0817d3738992bb1e89728a9cd939056bc919de9c995445aac8820f895204e0f14df4cff989c46456b382180e3a1685827a113dbb609518e88c6b944f9222698a -SHA512 (salt-2016.11.1.tar.gz) = 77ac9a676a14c367005c9821136a2842d515d0c19b5f64d95a5c447f83baac99e6d0da3d9554942467a0bfa5bb620f742432bc19e2e1f78af61ccebc72b89748