Commit Graph

91823 Commits

Author SHA1 Message Date
Erik Johnson
048728d2b7
Remove unused imports 2018-04-18 19:46:32 -05:00
Erik Johnson
879c557264
Use decorators for temp files/dirs in test suite
This adds a new decorator which creates a temporary directory and cleans
it after the test completes. It also modifies an existing decorator for
creating temporary files so that it accepts arguments, which will be
passed through to salt.utils.files.mkstemp().
2018-04-18 19:46:29 -05:00
Nicole Thomas
b46365614b
Merge pull request #47155 from mcalmer/fix-patchinstall
Fix patchinstall for yumpkg
2018-04-18 15:24:16 -04:00
Nicole Thomas
13ae1a2413
Merge pull request #47061 from terminalmage/issue47042
Fix diffing binary files in file.get_diff
2018-04-18 14:52:09 -04:00
Nicole Thomas
cba0f13cd9
Merge pull request #47058 from terminalmage/lsattr
Fix calls to file.lsattr when lsattr is not installed
2018-04-18 12:30:11 -04:00
Nicole Thomas
b96ce23b3f
Merge pull request #47104 from terminalmage/issue46929
yamlloader: Properly handle colons in inline dicts
2018-04-18 12:22:46 -04:00
Nicole Thomas
c12697b173
Merge pull request #47076 from terminalmage/issue46859
pillar_ldap: Load config options as str types
2018-04-18 12:16:22 -04:00
Daniel Wallace
50bd885ec7
Merge pull request #47107 from twangboy/fix_46932
Fix issues with reg state, add tests
2018-04-18 10:53:01 -05:00
Michael Calmer
382afba457 fix invalid string compare 2018-04-18 17:37:05 +02:00
Michael Calmer
8c19368938 provide kwargs to pkg_resource.parse_targets required to detect advisory type 2018-04-18 17:19:18 +02:00
Erik Johnson
87f6cefea3
Rewrite flaky utf8 state to make it easier to troubleshoot 2018-04-18 10:14:19 -05:00
Erik Johnson
df6e535f05
Fix diffing binary files in file.get_diff 2018-04-18 10:14:19 -05:00
Nicole Thomas
d6c59696be
Merge pull request #47041 from terminalmage/issue46909
Force null bytes to be str types
2018-04-18 10:08:24 -04:00
Nicole Thomas
9a9f6524f8
Merge pull request #47007 from twangboy/fix_46968
Fix some issues with the win_servermanager module
2018-04-17 16:57:04 -04:00
Erik Johnson
c06c859caf
pillar_ldap: Load config options as str types
Also make the same str type enforcement apply to all calls to _config()
in ldapmod.py.
2018-04-17 15:37:18 -05:00
Erik Johnson
e4182715be
Special check specifically for bytes types 2018-04-17 15:34:17 -05:00
Erik Johnson
eeb067e910
Fix calls to file.lsattr when lsattr is not installed
This was partially fixed before 2018.3.0, but some careless programming
since then has caused problems to return. This fixes those by making
`file.lsattr` return `None` when lsattr is not installed, and then fixes
all references to take this into account.
2018-04-17 15:19:15 -05:00
twangboy
ae8ab2ab1a
Fix tests for py3, enable tearDown 2018-04-17 13:59:12 -06:00
Nicole Thomas
a52137ee36
Merge pull request #47109 from garethgreenaway/46943_slack_engine_fixes
[2018.3] fixes to Slack engine
2018-04-17 09:56:26 -04:00
Nicole Thomas
6c16a34c44
Merge pull request #47045 from tankywoo/fix-gentoo-pkg-installed
Fix ba7d00f5 for gentoo pkg.installed method
2018-04-17 09:55:44 -04:00
Mike Place
ee90dd5d95
Merge branch '2018.3' into issue46909 2018-04-16 16:59:25 -06:00
Mike Place
86c7cfef56
Merge pull request #47053 from clan/jinja-error
handle jinja error in <module> level
2018-04-16 16:47:54 -06:00
Gareth J. Greenaway
02baa76595
Fixing a bug that occured when a comment was added to a message sent to Slack by Salt. Also making slack_engine:groups_pillar optional. 2018-04-16 15:39:20 -07:00
twangboy
3cf4ac1475
Add integration tests for reg state
Fix issues with binary data found in testing
2018-04-16 14:51:56 -06:00
twangboy
cc259b146f
Cast vdata to appropriate type in reg state
Creates a `cast_vdata` function in the reg util
Calls that function from the state to put the data in the appropriate
type
2018-04-16 14:51:56 -06:00
Mike Place
7bfa608e9f
Merge pull request #47062 from rallytime/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
2018-04-16 13:58:31 -06:00
Mike Place
fa27e64a33
Merge pull request #47066 from terminalmage/issue46979
Fix regression in handling of environment/saltenv
2018-04-16 13:57:11 -06:00
Erik Johnson
33bf6643cd
Add additional test for plain scalars 2018-04-16 12:17:20 -05:00
Erik Johnson
508659b682
yamlloader: Properly handle colons in inline dicts
PyYAML's scanner is not written to handle Python's unicode literal
strings, since they are not part of the YAML spec. With all strings
loaded in the YAML context now being unicode types, this causes errors
when scanning the document to construct the next node. The unicode
string literal is misidentified as a plain scalar and any colons within
it are interpreted as delimiting a mapping node. Since no whitespace appears
after the colon, this causes scanning error.

To fix it, we check for this scanning error and reset the scanner's
position and check if the first char is the "u" prefix. If so, and if
the following char is a quote, then we attempt to scan for a string
literal instead.
2018-04-16 11:29:51 -05:00
Erik Johnson
0e99343a7f
Use the same way of defining contents in both file.managed states 2018-04-13 23:07:39 -05:00
Erik Johnson
5741d287b5
Move back to using null byte check for contents 2018-04-13 23:06:27 -05:00
rallytime
59f5880e72
lint fix 2018-04-13 15:53:34 -04:00
Nicole Thomas
8761b81a69
Merge pull request #47051 from rallytime/fix-lint
Simplify LooseVersion check in `__virtual__` check in mac_assistive module
2018-04-13 15:43:32 -04:00
Nicole Thomas
bbb8018b55
Merge pull request #47057 from corywright/fix-minionfs-whitelist-docs
Fix copy/paste typo in minionfs tutorial
2018-04-13 15:43:00 -04:00
Nicole Thomas
432db7c6ec
Lint: Remove unused import 2018-04-13 15:29:19 -04:00
Erik Johnson
5c4c0468ad
Fix regression in handling of environment/saltenv
This was broken sometime between when the change was made and 2018.3.0
was released. This fixes the issue and adds a regression test.
2018-04-13 13:44:55 -05:00
rallytime
1ddf8c584b
Update old utils files to new new utils files path 2018-04-13 12:32:05 -04:00
rallytime
28a79ebba4
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/modules/win_lgpo.py
  - salt/netapi/rest_tornado/saltnado.py
2018-04-13 12:30:51 -04:00
Cory Wright
9b7ee97d12
Fix copy/paste typo in minionfs tutorial 2018-04-13 11:52:41 -04:00
Z. Liu
a847466946 handle jinja error in <module> level
prepare test case:
 # echo '{% import_yaml "a.yaml" as a with context %}' > a.sls
 # echo 'a: {{ "now"|strftime }}' > a.yaml

remove 'import salt.utils.daeutils' from salt/utils/templates.py, then run

 # salt-call state.sls a
[CRITICAL] Rendering SLS 'base:a' failed: Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/salt/utils/templates.py", line 169, in render_tmpl
    output = render_str(tmplstr, context, tmplpath)
  File "/usr/lib64/python2.7/site-packages/salt/utils/templates.py", line 395, in render_jinja_tmpl
    line, out = _get_jinja_error(trace, context=decoded_context)
  File "/usr/lib64/python2.7/site-packages/salt/utils/templates.py", line 248, in _get_jinja_error
    line = _get_jinja_error_line(trace)
  File "/usr/lib64/python2.7/site-packages/salt/utils/templates.py", line 231, in _get_jinja_error_line
    return _get_jinja_error_slug(tb_data)[1]
TypeError: 'NoneType' object has no attribute '__getitem__'

after apply the patch:

 # salt-call state.sls a
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/salt/utils/templates.py", line 169, in render_tmpl
    output = render_str(tmplstr, context, tmplpath)
  File "/usr/lib64/python2.7/site-packages/salt/utils/templates.py", line 402, in render_jinja_tmpl
    tmplstr)
SaltRenderError: Jinja syntax error: no filter named 'strftime'
/var/cache/salt/minion/files/base/a.yaml(1):
---
a: {{ "now"|strftime }}    <======================
---
[CRITICAL] Rendering SLS 'base:a' failed: Jinja syntax error: no filter named 'strftime'
/var/cache/salt/minion/files/base/a.yaml(1):
---
a: {{ "now"|strftime }}    <======================
---

which shows accurate information for debug.
2018-04-13 14:39:33 +00:00
Nicole Thomas
1700a10ebe
Merge pull request #46326 from kstreee/fix-client-local
Fixes a timing bug of saltnado's client local.
2018-04-13 09:59:27 -04:00
Nicole Thomas
d5afa4a2c5
Merge pull request #47046 from clan/file_diff
switch order of file to be diffed
2018-04-13 09:40:12 -04:00
Nicole Thomas
ec9251ecd3
Merge pull request #47048 from OrlandoArcapix/Issue46985-fix-grafana4-state
Issue46985 fix grafana4 state
2018-04-13 09:34:28 -04:00
Nicole Thomas
d8c4c221cf
Merge pull request #47017 from Unity-Technologies/hotfix/pip_windows
Don’t encode a unicode string
2018-04-13 09:31:32 -04:00
rallytime
d52b3689d9
Simplify LooseVersion check in __virtual__ check in mac_assistive module 2018-04-13 09:17:43 -04:00
Orlando Richards
259d747414 Remove accidentally added copy of a file 2018-04-13 11:29:35 +01:00
Orlando Richards
6c8c3da74d Return an empty dict instead of 'None' from grafana4 states
Fixes #46985
2018-04-13 09:55:54 +01:00
Z. Liu
bb58605c54 switch order of file to be diffed 2018-04-13 07:00:24 +00:00
Tanky Woo
551f4e10cf Fix ba7d00f5 for gentoo pkg.installed
The commit ba7d00f5 change _cpv_to_cp inner implementation, but the
original parameter cpv is not changed, its format is `<p>-<v>`, and
`dep_getkey` need format for `=<p>-<v>` if `cpv` with version, so it cause
`InvalidAtom` exception and actually return cpv itself. So I add the
original implementation back to fix this problem and still keep
`dep_getkey` if the cpv format will be fixed in the future
2018-04-13 14:53:09 +08:00
Erik Johnson
8e214c9fa9
file.managed: Add test to ensure binary contents work 2018-04-12 22:16:56 -05:00