Commit Graph

1367 Commits

Author SHA1 Message Date
Dmitry Kuzmenko
3ee328a28c
Salt Unicode Update 2018-01-22 14:38:24 +03:00
Erik Johnson
9df3dab883
[PY3] Add unicode_literals to pkg/pkgrepo states/modules 2018-01-20 22:21:41 -06:00
Erik Johnson
4ca7931655
[PY3] Update modules/states for PY3/Unicode compatibility (B)
This includes all the boto modules
2018-01-17 17:06:07 -06:00
Nicole Thomas
b90e7aedde
Merge pull request #45440 from terminalmage/py3-a
[PY3] Add unicode_literals to states/modules (A)
2018-01-14 07:52:02 -05:00
Nicole Thomas
4d03162227
Merge pull request #45396 from rallytime/merge-oxygen
[oxygen] Merge forward from 2017.7 to oxygen
2018-01-14 07:44:37 -05:00
Erik Johnson
ce6fccde9c
[PY3] Add unicode_literals to states/modules (A) 2018-01-14 01:31:52 -06:00
Erik Johnson
1044b627a1
[PY3] Add unicode_literals to salt.utils modules (A-D) 2018-01-13 16:08:56 -06:00
rallytime
bbe6f54f84
Update old utils paths to new paths 2018-01-12 12:27:08 -05:00
rallytime
60370f5fb6
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - salt/config/__init__.py
  - salt/daemons/masterapi.py
  - salt/proxy/dummy.py
  - salt/states/file.py
  - tests/integration/modules/test_state.py
  - tests/integration/runners/test_runner_returns.py
  - tests/integration/ssh/test_state.py
  - tests/support/parser/__init__.py
  - tests/unit/grains/test_core.py
  - tests/unit/states/test_file.py
2018-01-11 16:00:08 -05:00
Nicole Thomas
2340f0b487
Merge pull request #45380 from twangboy/backport_45308
Backport changes from #45308
2018-01-11 14:45:20 -05:00
twangboy
419be8a9b5
Backport changes from #45308 2018-01-10 11:16:59 -07:00
Erik Johnson
8bc17e0d7a
Fix integration.modules.test_state.StateModuleTest.test_exclude
test_exclude shares file paths with test_include, and while I can't
reproduce the failures, it is likely that improperly cleaned-up files
from test_include are causing the failures in test_exclude. This is
backed up by the fact that the state.sls return data from the
salt-runtests.log shows no trace of the "to-include-test" file
(suggesting it was excluded as expected), yet os.path.isfile() returns
True for this path, causing the test to fail.

This commit uses a distinct base dir for both tests, which should keep
this sort of failure from happening.
2018-01-10 10:29:15 -05:00
twangboy
53506a5e86
Fix some additional tests
- Fix problem with invalid characters in requisites.prereq_simple2
- Fix problem with true/false commands in Windows. Need to use exit
- Fix some issues with hard-coded paths to /tmp
2018-01-09 16:50:29 -07:00
twangboy
db52f086e3
Fix some tests in integration.modules.test_state
Fixes the following tests:
- test_get_file_from_env_in_top_match
- test_issue_1896_file_append_source
- test_state_sls_id_test

Fixes in issue in file.managed where a command execution error was being
raised if the target file did not exist.
2018-01-09 15:21:58 -07:00
rallytime
59076f5ee8
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - salt/client/ssh/wrapper/state.py
  - salt/modules/yumpkg.py
2018-01-04 17:45:29 -05:00
Ch3LL
74e6ed60ea
Fix MacOSX Service Status Check and integration test 2018-01-03 17:19:51 -05:00
Erik Johnson
002aa88a97
Replace yaml usage with a helper to ensure unicode is handled properly
Without allow_unicode=True, unicode characters are processed through the
str representer and on Python 2 are dumped as a Unicode code point (i.e.
a literal \u0414). This commit makes allow_unicode=True the default in
our salt.utils.yamlloader.safe_dump() helper. It also adds a new
salt.utils.yamlloader.dump() helper which wraps yaml.dump() and also
makes allow_unicode=True the default.

To make importing and using our custom yaml loader/dumper easier, a
convenience module called salt.utils.yaml has been added, which does a
wildcard import from both salt.utils.yamldumper and
salt.utils.yamlloader.

Refs to yaml.load/dump and yaml.safe_load/safe_dump have been updated to
salt.utils.yaml, to ensure that unicode is handled properly.
2018-01-03 14:14:21 -06:00
rallytime
da1e33abea
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - pkg/windows/req_base.txt
  - salt/engines/slack.py
  - salt/modules/cmdmod.py
  - salt/modules/osquery.py
  - salt/modules/pip.py
  - salt/modules/win_pkg.py
  - salt/states/pip_state.py
  - tests/integration/modules/test_cmdmod.py
2017-12-30 08:44:11 -05:00
Erik Johnson
4bf072435d
Fix integration.modules.test_state.StateModuleTest.test_exclude
test_exclude shares file paths with test_include, and while I can't
reproduce the failures, it is likely that improperly cleaned-up files
from test_include are causing the failures in test_exclude. This is
backed up by the fact that the state.sls return data from the
salt-runtests.log shows no trace of the "to-include-test" file
(suggesting it was excluded as expected), yet os.path.isfile() returns
True for this path, causing the test to fail.

This commit uses a distinct base dir for both tests, which should keep
this sort of failure from happening.
2017-12-24 12:08:57 -06:00
Gareth J. Greenaway
48eafe3206
Adding some tests to tests cmd.script with cwd 2017-12-21 15:53:38 -08:00
rallytime
9ded5e1cbb
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - salt/config/__init__.py
  - salt/grains/core.py
  - salt/modules/win_lgpo.py
  - salt/returners/mysql.py
  - salt/states/libcloud_dns.py
  - tests/integration/runners/test_runner_returns.py
  - tests/unit/grains/test_core.py
2017-12-21 15:58:08 -05:00
Nicole Thomas
e0d7b330fa
Merge pull request #44650 from frogunder/status
add status.pid test
2017-12-19 11:21:08 -05:00
Erik Johnson
8cdb9ea54f
[PY3] Add print_function import to files with unicode_literals already added
This makes the 2.x usage invalid syntax and forces the use of print as a
function. This adds the import to the files which I've updated in the
last couple of days but forgot to add it.
2017-12-15 12:14:18 -06:00
Nicole Thomas
653ad2a224
Merge pull request #44946 from terminalmage/unicode-file
[PY3] Update file state/execution modules and associated files with unicode_literals
2017-12-14 16:26:50 -05:00
Erik Johnson
5e1f75aab0
[PY3] Add unicode_literals to docker state/execution modules 2017-12-13 22:49:23 -06:00
Erik Johnson
1bfc53fc57
Update file state/execution modules and associated files with unicode_literals
This updates the file state and execution modules to use
unicode_literals. Since the serializers and the cmd module are touched
by the file state/exec module, those are also updated here, as well as
the cmd state module, for good measure.

Additionally, I found that salt.utils.data.decode_dict (and decode_list)
are misnamed for what they actually do. Since they *encode* the
contents, the functions should be named encode_dict and encode_list,
respectively. And we also should have counterparts which actually
decode, so I've added them. The compatibility functions from salt.utils
still use the old "decode" names to preserve backward compatibility, but
they now invoke the renamed "encode" functions in salt.utils.data. Note
that this means that the compatibility functions
salt.utils.decode_dict/list, and their cognates in salt.utils.data now
do different things, but since the move to salt.utils.data is also
happening in the Oxygen release this is as good a time as any to correct
this oversight.

I've updated the jinja filter docs to include information on the renamed
jinja filters, and also added a section on jinja filter renaming to the
Oxygen release notes. There was another filter that I renamed during the
process of moving functions from salt.utils which I did not properly
document in the release notes, so this is now included along with the
others.
2017-12-13 16:43:45 -06:00
rallytime
db5866d097
Update old utils paths to new utils paths 2017-12-11 18:43:33 -05:00
rallytime
08c71f13e4
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - doc/ref/configuration/minion.rst
  - doc/topics/thorium/index.rst
  - salt/beacons/__init__.py
  - salt/client/mixins.py
  - salt/client/ssh/wrapper/state.py
  - salt/daemons/masterapi.py
  - salt/grains/extra.py
  - salt/minion.py
  - salt/modules/cron.py
  - salt/modules/file.py
  - salt/modules/mac_user.py
  - salt/modules/napalm_network.py
  - salt/modules/state.py
  - salt/modules/win_file.py
  - salt/modules/win_pkg.py
  - salt/proxy/dummy.py
  - salt/state.py
  - salt/states/file.py
  - salt/states/lxc.py
  - salt/utils/__init__.py
  - salt/utils/schedule.py
  - tests/integration/modules/test_file.py
  - tests/integration/modules/test_groupadd.py
  - tests/integration/ssh/test_state.py
  - tests/integration/states/test_file.py
  - tests/unit/daemons/test_masterapi.py
  - tests/unit/grains/test_core.py
  - tests/unit/modules/test_disk.py
  - tests/unit/modules/test_napalm_network.py
  - tests/unit/modules/test_state.py
  - tests/unit/test_minion.py
  - tests/unit/utils/test_process.py
2017-12-11 18:24:41 -05:00
Nicole Thomas
54d29a61cb
Merge pull request #44787 from rallytime/groupadd-destructive-clean
GroupAdd test: Add destructive test decorator to entire class
2017-12-11 13:14:17 -05:00
Nicole Thomas
2a2fad5037
Merge pull request #44818 from Ch3LL/test_true_minion
Allow test arg to be used on master or pillar
2017-12-08 17:36:25 -05:00
Nicole Thomas
74ee7ce541
Merge pull request #44748 from twangboy/osx_fix_auto_login
Fix auto login support for OSX
2017-12-07 09:22:22 -05:00
Nicole Thomas
904c0da893
Merge branch '2017.7' into status 2017-12-06 12:51:52 -05:00
Erik Johnson
01a76919cb
Add hide_output option to cmd state/exec module
We have `output_loglevel` for controlling logging, but no corresponding
option to suppress the output from the command from being returned. This
adds a `hide_output` option to do that.

Additionally, this removes the rest of the references to the
long-since-deprecated `quiet` argument from the cmd execution module,
and adds a warning to states which use this argument. `quiet` appears to
have been incompletely removed following its deprecation. It was not
being passed to _check_loglevel(), so it was essentially ignored, but it
was still being accepted as an argument by several functions. Those
references to what has for some time now been a no-op argument are now
removed.
2017-12-05 16:10:02 -06:00
Ch3LL
cdbacfaf5c
Remove minions_state_test arg and use default test arg 2017-12-05 14:12:24 -05:00
Ch3LL
499541a8e8
Add new option minions_state_test to enable test on master side 2017-12-05 14:12:20 -05:00
twangboy
068e463870
Fix lint, add integration tests 2017-12-04 13:29:37 -07:00
rallytime
3d9eafc4bd
Lint: Remove extra empty lines at end of files 2017-12-01 14:46:27 -05:00
rallytime
817ac002b0
Add destructive test decorator to test class
Because the destructive test decorator was applied to the tearDown
function, the tests show a stacktrace instead of a nice skip message
when running without the `--run-destructive` flag. By applying the
decorator to the test class (since all tests are destructive anyway)
we can keep the output clean and still skip tests appropriately.
2017-12-01 14:33:38 -05:00
rallytime
239f3511bf
Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/modules/reg.py
  - salt/modules/state.py
  - salt/modules/win_pkg.py
  - salt/netapi/rest_cherrypy/app.py
  - salt/utils/__init__.py
  - tests/integration/modules/test_file.py
  - tests/integration/output/test_output.py
  - tests/unit/grains/test_core.py
2017-12-01 11:12:44 -05:00
Mircea Ulinic
dce017b3f7
Make tests happy 2017-11-30 15:50:11 +00:00
Nicole Thomas
5ec7ea0bb5
Merge pull request #44572 from Ch3LL/watchin_test
Add watch_in integration test
2017-11-27 15:52:31 -05:00
Frode Gundersen
619bd2be1e fix lint error 2017-11-22 21:41:59 +00:00
Frode Gundersen
d406cb07a3 add status.pid test 2017-11-22 18:11:39 +00:00
rallytime
052b13c98e
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/cli/daemons.py
  - salt/client/ssh/__init__.py
  - salt/modules/win_pkg.py
  - salt/netapi/rest_cherrypy/app.py
  - salt/proxy/fx2.py
  - salt/utils/__init__.py
  - salt/utils/jinja.py
  - salt/utils/napalm.py
  - salt/utils/path.py
  - salt/utils/verify.py
  - tests/integration/modules/test_saltutil.py
  - tests/integration/states/test_service.py
  - tests/unit/utils/test_verify.py
2017-11-22 12:36:03 -05:00
Ch3LL
c9ba33432e
Add Non Base Environement salt:// source integration test 2017-11-20 16:53:56 -05:00
Ch3LL
3df70f3fed
remove iter for watch_in failure test 2017-11-20 11:32:26 -05:00
Ch3LL
ac437ddf90
add order check and remove iter 2017-11-20 11:19:25 -05:00
Gareth J. Greenaway
3d2f305053
Fixing expected test results. 2017-11-16 16:02:56 -08:00
Gareth J. Greenaway
784cc7a85a
Merge remote-tracking branch 'upstream/develop' into develop 2017-11-16 09:53:04 -08:00
Ch3LL
5f2b4f434e
Add watch_in integration test 2017-11-16 12:18:30 -05:00