Commit Graph

91980 Commits

Author SHA1 Message Date
Daniel A. Wozniak
3d85e30ce5
AsyncTestCase is required for AsyncEventPublisher
Other tests that use AsyncTestCase's io_loop will break if AsyncTestCase
is not subclassed when a test instantiates AsyncEventPublisher.
2018-04-16 14:18:08 -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
Mike Place
03892eaf0b
Merge pull request #47068 from cachedout/catch_value_error_socket_test
Catch an operation on a closed socket in a test
2018-04-16 13:56:02 -06:00
Erik Johnson
fed5041c5f
Make error more specific to aid in troubleshooting 2018-04-16 12:55:57 -05:00
Erik Johnson
8c67ab53b4
Fix path in log message
The actual error refers to the parent dir of the master/minion/etc. pki
subdir (i.e. /etc/salt/pki instead of /etc/salt/pki/minion). Therefore,
the startswith check needs to look for the parent of the pki_dir.
2018-04-16 12:48:06 -05:00
Erik Johnson
3198ca8b19
Make error more explicit when PKI dir not present for salt-call 2018-04-16 12:44:41 -05: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
Shane Lee
1ea2885ec2
Merge pull request #47065 from dwoz/jinja_test_fix
Jinja test fix
2018-04-16 10:16:41 -06:00
Shane Lee
673cd31c65
Merge branch '2017.7' into jinja_test_fix 2018-04-16 10:15:27 -06:00
Daniel Wallace
5293b5b5ca
Merge pull request #47077 from dwoz/test_state_fix
Fix failing state test by normalizing line endings
2018-04-16 10:48:38 -05:00
Daniel Wallace
ca967de5da
Merge pull request #47067 from gtmanfred/2017.7
use the recommended opennebula lookup method
2018-04-16 10:48:14 -05:00
Daniel A. Wozniak
444da3f893
Fix py3 wart (chr vs bytesstring) 2018-04-14 17:39:29 -07:00
Daniel A. Wozniak
46fa2c04de
Fix py3 os.linesep wart 2018-04-14 17:09:50 -07:00
Daniel A Wozniak
e8acca01c2
Fix failing state test by normalizing line endings
Fixes:

integration.modules.test_state.StateModuleTest.test_issue_1896_file_append_source
2018-04-14 15:45:11 -07:00
Daniel Wozniak
7fddad6cd9
Merge pull request #47064 from dwoz/roots_tests_fix
Fix fileserver roots tests
2018-04-14 14:30:22 -07:00
Mike Place
977c6939c4
Merge pull request #47069 from cachedout/match_timeout_arg
Pass the timeout variable to the CLI when calling salt in tests
2018-04-14 09:20:25 -06:00
Daniel Wallace
2c4c19c622
Merge pull request #47074 from dwoz/ignore_artifacts
Kitchn should ignore artifacts directory
2018-04-14 08:06:18 -05:00
Daniel A. Wozniak
c3941efad0
Kitchn should ignore artifacts directory 2018-04-14 00:42:04 -07: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
Mike Place
b8990f5258
Pass the timeout variable to the CLI when calling salt in tests 2018-04-13 16:37:01 -06:00
Nicole Thomas
c484c0bd71
Merge pull request #47055 from bloomberg/GH-47000
#47000 - add proper handling of full_return in cmd_subset
2018-04-13 16:17:09 -04:00
Daniel A. Wozniak
3c565d7e54
Use salt.utils.fopen 2018-04-13 13:14:19 -07:00
Mike Place
7db5625632
Catch an operation on a closed socket in a test
This failure wouldn't be related to the test in question so it should
be safe to ignore.
2018-04-13 13:54:18 -06:00
rallytime
59f5880e72
lint fix 2018-04-13 15:53:34 -04:00
Daniel Wallace
f913a7859c
use the recommended opennebula lookup method 2018-04-13 14:45:18 -05: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
Daniel A. Wozniak
25fd7c0694
fix py3 wart, encode os.linesep 2018-04-13 12:33:23 -07: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
Nicole Thomas
f3496030cc
Merge pull request #47039 from twangboy/win_fix_winrm_script
Fix winrm powershell script
2018-04-13 14:09:55 -04:00
Daniel A. Wozniak
aa965310f1
Clean up cruft 2018-04-13 10:27:17 -07:00
Daniel A Wozniak
efc9866580
Jinja test fixes 2018-04-13 10:23:34 -07:00
Daniel A Wozniak
d79f1a1961
Fix fileserver roots tests 2018-04-13 10:15:13 -07: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
Orlando Richards
f115452653 Return an empty dict for 'changes' instead of 'None'
Fixes #47059
2018-04-13 17:20:23 +01:00
Cory Wright
9b7ee97d12
Fix copy/paste typo in minionfs tutorial 2018-04-13 11:52:41 -04:00
Matt Phillips
8af3f5b874 GH-47000: add proper handling of full_return in cmd_subset
as noted in the original issue, full_return wasnt being handled properly. This
rectifies that.
2018-04-13 10:58:03 -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