Commit Graph

86190 Commits

Author SHA1 Message Date
Erik Johnson
4d7bcff58f Rename cache_source arg to keep_source
This new argument name is ambiguous as "cache" can either be interpreted
as a noun or a verb.
2017-09-21 12:04:53 -05:00
Erik Johnson
bb1d40e425 Guard against exceptions when running file.cached state within archive.extracted
The code used to have a salt.state.HighState instance call the state.
That method pre-dated availability of __states__ to use for executing
the state function. The HighState instance handles exception catching
and produces a list as output if there were errors which arose before
the state was executed. Running the state function using __states__ does
not give you any such protection. This commit removes the type check on
the return data, as it will never be a list when run via __states__, and
wraps the state function in a try/except to catch any exceptions that
may be raised by invoking the file.cached state.
2017-09-21 12:04:53 -05:00
Erik Johnson
68ae5a2ec6 Add documentation for using file.cached state within other states 2017-09-21 12:04:52 -05:00
Erik Johnson
fd1d89d385 Reduce unnecessary file downloading in archive/file states
The file.managed state, which is used by the archive.extracted state to
download the source archive, at some point recently was modified to
clear the file from the minion cache. This caused unnecessary
re-downloading on subsequent runs, which slows down states considerably
when dealing with larger archives.

This commit makes the following changes to improve this:

1. The fileclient now accepts a `source_hash` argument, which will cause
   the client's get_url function to skip downloading http(s) and ftp
   files if the file is already cached, and its hash matches the passed
   hash. This argument has also been added to the `cp.get_url` and
   `cp.cache_file` function.

2. We no longer try to download the file when it's an http(s) or ftp URL
   when running `file.source_list`.

3. Where `cp.cache_file` is used, we pass the `source_hash` if it is
   available.

4. A `cache_source` argument has been added to the `file.managed` state,
   defaulting to `True`. This is now used to control whether or not the
   source file is cleared from the minion cache when the state
   completes.

5. Two new states (`file.cached` and `file.not_cached`) have been added
   to managed files in the minion cache.

In addition, the `archive.extracted` state has been modified in the
following ways:

1. For consistency with `file.managed`, a `cache_source` argument has
   been added. This also deprecates `keep`. If `keep` is used,
   `cache_source` assumes its value, and a warning is added to the state
   return to let the user know to update their SLS.

2. The variable name `cached_source` (used internally in the
   `archive.extracted` state) has been renamed to `cached` to reduce
   confusion with the new `cache_source` argument.

3. The new `file.cached` and `file.not_cached` states are now used to
   manage the source tarball instead of `file.managed`. This improves
   disk usage and reduces unnecessary complexity in the state as we no
   longer keep a copy of the archive in a separate location within the
   cachedir. We now only use the copy downloaded using `cp.cache_file`
   within the `file.cached` state. This change has also necessitated a
   new home for hash files tracked by the `source_hash_update` argument,
   in a subdirectory of the minion cachedir called `archive_hash`.
2017-09-21 12:04:52 -05:00
Mike Place
0e9eaed62c Merge pull request #43653 from terminalmage/gitfs-update-url
salt.utils.gitfs: Enforce fetch URL along with refspecs and http.sslVerify
2017-09-21 10:53:21 -06:00
Mike Place
12b5e62d81 Merge pull request #43671 from rallytime/merge-2017.7
[2017.7] Merge forward from 2017.7.2 to 2017.7
2017-09-21 10:39:48 -06:00
Mike Place
e3a2fbc2a3 Merge pull request #43676 from terminalmage/runners-docs-2017.7
Fix RST headers for runners (2017.7 branch)
2017-09-21 10:36:20 -06:00
Mike Place
d6057a8007 Merge pull request #43678 from rallytime/add-purefa-autodocs
Add autodoc file for new purefa execution module
2017-09-21 10:35:20 -06:00
Alexandru Bleotu
f46afa0fa9 Removed references to Pthon 2.6 as it's no longer supported in Salt 2017-09-21 12:31:40 -04:00
Alexandru Bleotu
2f55841037 Added python/pyvmomi compatibility check to salt.modules.vsphere 2017-09-21 12:31:38 -04:00
Alexandru Bleotu
5f30477a6a Added python/pyvmomi compatibility check to salt.states.esxcluster 2017-09-21 12:31:36 -04:00
vernoncole
292f8c79b8 correct default value for salt.cache.Cache 2017-09-21 10:26:00 -06:00
Erik Johnson
9b74634b23 Fix badly-formatted RST in mattermost runner docstring 2017-09-21 10:54:27 -05:00
rallytime
bd88c375d8
Add autodoc file for new purefa execution module 2017-09-21 11:51:15 -04:00
Vladimir Nadvornik
1c006db2a6 Fix and extend mdadm unit tests 2017-09-21 17:46:15 +02:00
Vladimir Nadvornik
6fcb7e7739 Minor bugfixes
- do not try to add devices if assemble failed
- sort uuid list in error message
2017-09-21 17:43:05 +02:00
Erik Johnson
c0a79c70a4 Fix RST headers for runners (2017.7 branch)
To conform with the rest of the rst files for runner docs, they should
only contain the module name.
2017-09-21 10:27:12 -05:00
rallytime
a401166bd5 Merge branch '2017.7.2' into '2017.7'
No conflicts.
2017-09-21 09:52:38 -04:00
Nicole Thomas
f66eb1c5ad Merge pull request #43588 from gtmanfred/do
digitalocean should be one word.
2017-09-21 09:25:38 -04:00
Nicole Thomas
f4eac59d96 Merge pull request #43652 from VertigoRay/patch-1
Salt Repo has Deb 9 and 8
2017-09-21 09:19:27 -04:00
Nicole Thomas
9eab1ea94c Merge pull request #43663 from moio/develop-multiprocessing-doc-fix
multiprocessing minion option: documentation fixes (develop)
2017-09-21 09:01:30 -04:00
Joaquin Veira
fda66f3e92 corrected identation 2017-09-21 13:38:27 +02:00
Alexandru Bleotu
cbefa4d3fd Fixed except statement 2017-09-21 06:42:52 -04:00
Silvio Moioli
4a35fe5019 multiprocessing minion option: documentation fixes 2017-09-21 11:30:21 +02:00
Alexandru Bleotu
ee0dcd7b67 More pylint 2017-09-21 05:01:19 -04:00
Alexandru Bleotu
1706c24add Imported salt.exceptions in salt.states.esxcluster 2017-09-21 04:14:59 -04:00
Erik Johnson
5d45329111 salt.utils.gitfs: Enforce fetch URL along with refspecs and http.sslVerify
This fixes a corner case in which someone is using the `name` config
param for a given gitfs/git_pillar remote, and then changes the URL for
that remote (for instance, between https and ssh). We've simply never
enforced the fetch URL in the git config for a given remote's cachedir,
since the cachedir is typically determined by hashing the URL (or branch
+ URL for git_pillar). In those cases, changing the URL changes the
cachedir path, and results in a new repo being init'ed and the correct
URL being added to the git config as part of the initialization. But,
when using the `name` param, the path to the cachedir would remain
constant no matter what the URL is. This means that when the URL is
changed in the gitfs/git_pillar config, it isn't actually updated in the
git config file for that cachedir.

With this change, the new GitConfigParser is used to examine the fetch
URL and update it if necessary.
2017-09-21 00:05:10 -05:00
Raymond Piller
5f47ef721c Salt Repo has Deb 9 and 8 2017-09-20 21:41:08 -05:00
Tom Williams
d2106f79bb INFRA-5461 - Use the same var name in both places, Tom :) 2017-09-20 21:47:06 -04:00
Tom Williams
45096a5d56 INFRA-5461 - sanity check return 2017-09-20 21:46:49 -04:00
Tom Williams
69049c1da6 INFRA-5461 - more boto_elb AWS rate limiting fixes 2017-09-20 21:46:34 -04:00
Daniel Wallace
2f3be5785b
there were more 2017-09-20 15:55:37 -06:00
Nicole Thomas
d02953ce6a Merge pull request #43235 from brejoc/improve-async-operation-handling-in-kubernetes-module
Improve delete_deployment handling
2017-09-20 17:33:32 -04:00
Alexandru Bleotu
491faaa2ab Review changes 2017-09-20 17:20:39 -04:00
Nicole Thomas
4fa0b3d038 Merge branch 'develop' into fix-boto3-util-pack-error 2017-09-20 17:15:41 -04:00
Alexandru Bleotu
23f58c0ff3 Even more pylint 2017-09-20 17:07:17 -04:00
Alexandru Bleotu
819e015d33 Added InvalidEntityError in salt.exceptions 2017-09-20 17:02:17 -04:00
Alexandru Bleotu
aa26f0bb83 Fixed list_differ because of ignore_unset_values change in dictdiffer 2017-09-20 13:54:58 -04:00
Alexandru Bleotu
a41b5072da more pylint 2017-09-20 13:40:36 -04:00
Mike Place
8cf0588221 Merge pull request #43552 from morganwillcock/comspec
Shell grain: check %COMSPEC% for the shell for Windows
2017-09-20 10:07:09 -06:00
Mike Place
73cb0c27b5 Merge pull request #43554 from twangboy/win_fix_chocolatey
Win fix chocolatey
2017-09-20 10:06:17 -06:00
Mike Place
635da91135 Merge pull request #43564 from epcim/fix-nacl-decrypt
Fix names of NACL dec. methods
2017-09-20 10:02:40 -06:00
Daniel Wallace
f54ddae6bb
fix do test where space was seperated by a newline 2017-09-20 09:57:57 -06:00
Mike Place
58278a10d3 Merge pull request #43603 from Juniper/develop
keep alive feature for junos and schedular support for rpc call
2017-09-20 09:47:35 -06:00
Mike Place
ed7eeaaafb Merge pull request #43625 from gtmanfred/2017.7
results and columns are lists for mysql returns
2017-09-20 09:42:59 -06:00
Alexandru Bleotu
8cdaf01642 pylint 2017-09-20 09:40:22 -04:00
Alexandru Bleotu
4f4db431fa Fixed tests for the ignore_unset_values change 2017-09-20 09:40:20 -04:00
Alexandru Bleotu
f7f4f34c3a Moved ignore_unset_values parameter as a RecursiveDictDiffer attribute 2017-09-20 09:35:44 -04:00
Alexandru Bleotu
9f0d639358 Skip ext vsan libraries pylint checks 2017-09-20 09:32:54 -04:00
Alexandru Bleotu
7bb54430ab Added licenses_configured state that checks the the VSAN licenses are added to the vCenter and assigned to the cluster 2017-09-20 06:29:05 -04:00