Commit Graph

86597 Commits

Author SHA1 Message Date
Mike Place
aa47da35dd Merge pull request #43697 from rallytime/merge-2017.7
[2017.7] Merge forward from 2016.11 to 2017.7
2017-09-22 11:31:08 -06:00
Mike Place
530a6bb2e7 Merge pull request #43698 from theredcat/elastic-timeout
Add timeout option to elasticsearch execution module
2017-09-22 11:30:14 -06:00
Z. Liu
da15658304 remove modify yaml constructor
which will modify the default behavior of yaml load.

Foe example, for following example (t.sls), it will cause the difference
between the content of file testa and testb, but it should be identical!

$ cat t
{%- load_yaml as vars %}
toaddr:
  - test@test.com
{%- endload -%}
{{ vars.toaddr }}
$ cat t.sls
/tmp/testa:
  file.managed:
    - source: salt://t
    - user: root
    - group: root
    - mode: "0755"
    - template: jinja

sys-power/acpid:
  pkg.installed:
    - refresh: False

/tmp/testb:
  file.managed:
    - source: salt://t
    - user: root
    - group: root
    - mode: "0755"
    - template: jinja
$ touch /tmp/test{a,b}
$ salt-call state.sls t
local:
----------
          ID: /tmp/testa
    Function: file.managed
      Result: None
     Comment: The file /tmp/testa is set to be changed
     Changes:
              ----------
              diff:
                  ---
                  +++
                  @@ -0,0 +1 @@
                  +['test@test.com']
----------
          ID: /tmp/testb
    Function: file.managed
      Result: None
     Comment: The file /tmp/testb is set to be changed
     Changes:
              ----------
              diff:
                  ---
                  +++
                  @@ -0,0 +1 @@
                  +[u'test@test.com']
2017-09-22 23:25:21 +08:00
Nicole Thomas
91edf865e2 Merge branch '2017.7' into issue38971-2017.7 2017-09-22 10:50:57 -04:00
Nicole Thomas
c0bfa7a77c Merge pull request #43684 from rklaren/salt-cloud-libvirt-fix-python-warning
salt-cloud libvirt updates
2017-09-22 10:50:11 -04:00
Nicole Thomas
0ec22d48a0 Merge pull request #43688 from abergmann/develop
Extend openscap module command parsing.
2017-09-22 10:43:52 -04:00
Nicole Thomas
49bb3b0a52 Merge branch 'develop' into issue38971 2017-09-22 10:38:34 -04:00
Nicole Thomas
7448153154 Merge pull request #43691 from dmyerscough/fix-docstring-formatting
Fix docstring code-blocks
2017-09-22 10:34:51 -04:00
rallytime
cbae45bec4
Lint: Remove extra line at end of file 2017-09-22 10:33:10 -04:00
rallytime
e0ae50e489
Merge branch '2017.7' into 'develop'
Conflicts:
  - pkg/salt.bash
  - salt/client/mixins.py
  - salt/minion.py
  - salt/modules/aptpkg.py
  - salt/modules/boto_vpc.py
  - salt/modules/win_pkg.py
  - salt/utils/reactor.py
  - tests/unit/utils/test_reactor.py
2017-09-22 10:24:04 -04:00
Nathan DELHAYE
25a1958304 Add timeout option to elasticsearch execution module 2017-09-22 15:49:44 +02:00
rallytime
fca4e5563a
Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/modules/win_pkg.py
  - tests/unit/utils/test_parsers.py
2017-09-22 09:40:03 -04:00
Joaquin Veira
43ded54132 Update zabbix_return.py
corrected indentation and other suggestions by jenkins
2017-09-22 11:43:44 +02:00
Tom Williams
f6a8a969a4 INFRA-5292 - we must please pylint ... 2017-09-22 05:19:51 -04:00
Vladimir Nadvornik
9d450f7737 Fix python3 compatibility 2017-09-22 10:24:11 +02:00
assafShapira
d35eb099e2 Merge branch 'develop' into develop 2017-09-22 10:33:10 +03:00
assaf shapira
0e17b2054f Merge branch 'develop' of https://github.com/assafShapira/salt into develop 2017-09-22 10:31:53 +03:00
Dmitry Kuzmenko
1c979d5809 Update redis cache contains logic to use more efficient sismember. 2017-09-22 10:30:28 +03:00
Damian Myerscough
012281dea2 Fix docstring code-blocks 2017-09-21 22:46:03 -07:00
Damon Atkins
4c88c80ef9 Merge branch '2017.7' into 2017.7_update_safe_filename_func 2017-09-22 13:53:18 +10:00
Ric Klaren
b750c44224 Fix some lint warnings 2017-09-21 22:38:13 -05:00
Ric Klaren
7595f97488 Ensure libvirt does not write to stderr by itself
Install error handler and redirect stderr output to debug log.
2017-09-21 22:38:13 -05:00
Ric Klaren
ab0892c802 Fix fire_event for destroy 2017-09-21 22:38:13 -05:00
Ric Klaren
022a25e3fc Mention Fedora 26 support 2017-09-21 22:38:13 -05:00
Tom Williams
7f9a7e2857 INFRA-5292 - add support to fluent logger for Graylog and GELF output formats 2017-09-21 20:31:18 -04:00
Mike Place
e6dc4d64df Merge pull request #43314 from twangboy/win_fix_unit.utils.test_verify
Fix `unit.utils.test_verify` for Windows
2017-09-21 16:26:12 -06:00
Mike Place
d7b19ab64f Merge pull request #43686 from terminalmage/issue43383
Make git_pillar runner return None when no changes are fetched
2017-09-21 15:44:48 -06:00
Mike Place
426eb92474 Merge branch 'develop' into raid_add 2017-09-21 15:37:31 -06:00
Mike Place
9c585e052f Merge pull request #43683 from rallytime/stale-config-update
Reduce the number of days an issue is stale by 30
2017-09-21 14:58:36 -06:00
Alexander Bergmann
f5188cb886 Extend openscap module command parsing.
This commit extends the cmd_pattern with unknown parts of the parsing
process. Otherwise it is not possible to customize the openscap XCCDF
execution with additional parameters like --remediate.
2017-09-21 22:28:31 +02:00
Mike Place
ed22e0f2fd Merge pull request #43507 from rallytime/replace-utils-calls
Update which and is_windows calls to use new paths
2017-09-21 14:11:21 -06:00
Mike Place
ec34df2c27 Merge pull request #43680 from vernondcole/fix-salt.cache.Cache-default
correct default value for salt.cache.Cache
2017-09-21 14:09:35 -06:00
Mike Place
9fc0699613 Merge pull request #43511 from spenceation/panos/security-rule
- Added get_security_rule function to PANOS execution module.
2017-09-21 14:08:32 -06:00
Michal Kurtak
b1e64b11fb yumpkg.py: install calls list_repo_pkgs only if wildcard in pkg name is used
Fixes #43396
2017-09-21 21:51:22 +02:00
Erik Johnson
7dcac84521 Make git_pillar runner return None when no changes are fetched
This distinguishes cases in which no changes were fetched from those
when there were errors.
2017-09-21 14:05:31 -05:00
Mike Place
310f826cc0 Merge pull request #43524 from kbespalov/develop
[network.interface_ip] Correct handling of interfaces without IP
2017-09-21 12:06:24 -06:00
Mike Place
99d9d784b1 Merge pull request #43530 from twangboy/win_fix_pkg.install
Fixes removal of double-quotes by shlex_split in winrepo
2017-09-21 12:04:47 -06:00
Nicole Thomas
4d50243971 Merge pull request #43544 from lyft/fix-boto3-util-pack-error
Fix boto3 util pack error
2017-09-21 14:04:09 -04:00
Mike Place
9dba34aa06 Merge pull request #43575 from akissa/fix-csr-not-recreated-if-key-changes
Fix CSR not recreated if key changes
2017-09-21 11:52:00 -06:00
rallytime
100113726c
Reduce the number of days an issue is stale by 30 2017-09-21 13:18:07 -04:00
Erik Johnson
84f34c93be Backport the non-fileclient changes from PR 43518 to 2017.7
This fixes the unnecessary re-downloading reported in #38971 in 2017.7
without using the new fileclient capabilities added in develop. It
includes a helper function in the `file.cached` state that will need to
be removed once we merge forward into develop.
2017-09-21 12:05:38 -05:00
Erik Johnson
8b237c129a Improve logging when keeping the cached source file 2017-09-21 12:04:53 -05:00
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
1d4fa48209 Merge pull request #43672 from rallytime/bp-43415
Back-port #43415 to 2016.11
2017-09-21 10:38:55 -06:00
Mike Place
ff832ee607 Merge pull request #43673 from rallytime/bp-43652
Back-port #43652 to 2016.11
2017-09-21 10:37:35 -06:00