Commit Graph

3575 Commits

Author SHA1 Message Date
Erik Johnson
033f34ee21
Fix failing boto/network tests
These failures were recently introduced but went undiscovered due to
some recent instability in the test suite (which has now been fixed).

This commit fixes these failing tests.
2018-01-21 17:24:11 -06:00
twangboy
50859057ed
Skip tests on Windows, gate module on Windows 2018-01-18 13:27:56 -07:00
twangboy
176d3aab62
Revert one more indent 2018-01-18 13:27:56 -07:00
twangboy
38c2ce2fa0
Revert indents 2018-01-18 13:27:55 -07:00
twangboy
f72e7c28f2
Revert imports 2018-01-18 13:27:55 -07:00
twangboy
fbb4e712e7
revert changes to unittest 2018-01-18 13:27:55 -07:00
twangboy
3126af7661
Fix patch indenting, remove :returns: 2018-01-18 13:27:55 -07:00
twangboy
18bc68939c
Fix broken tests, use correct assert functions 2018-01-18 13:27:54 -07: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
rallytime
9e7aeb5e02
Change "to_str" to "to_bytes": needed when opening a file in bytes mode
References: https://github.com/saltstack/salt/pull/45357
2018-01-16 10:41:46 -05:00
Nicole Thomas
c00fddd5bb
Merge pull request #45357 from twangboy/win_fix_test_file
Fix `unit.modules.test_file` for Windows
2018-01-14 08:14:24 -05:00
Nicole Thomas
78ce60e4d4
Merge pull request #44977 from terminalmage/remove-more-explicit-unicode-literals
Remove more unnecessary explicit unicode literals
2018-01-14 07:55:29 -05:00
Erik Johnson
ce6fccde9c
[PY3] Add unicode_literals to states/modules (A) 2018-01-14 01:31:52 -06:00
Erik Johnson
b89efc16eb
Remove more unnecessary explicit unicode literals 2018-01-13 21:10:04 -06:00
Nicole Thomas
04b8e1cafc
Merge pull request #45401 from gtmanfred/oxygen
fix boto import failures
2018-01-12 10:55:48 -05:00
Daniel Wallace
c378c356eb
fix moto version
Fixes saltstack/salt-jenkins#692
2018-01-11 17:42:59 -07:00
twangboy
df64c60530
Remove hard-coded, linux-style paths 2018-01-11 23:24:46 +00:00
Daniel Wallace
fdcf71a10c
fix test boto imports
Test boto imports are failing for some reason
2018-01-11 15:14:25 -07:00
twangboy
5d45a4478f
Fix unit.modules.test_file for Windows
Fixes `_regex_to_static` function for Windows. Regex returns the `\r`
portion of the Windows line ending as part of the regex search. We're
going to trim that off the end.

Skips `test_check_file_meta_no_lsattr` as there is this is Linux
specific

Opens files in binary mode on Windows in the tests

Changes to the appropriate assert calls

Fixes line ending issues in the file_content and file_modified variables
in the test
2018-01-09 15:17:25 -07:00
twangboy
fe2d4ae65b
Fix paths on Windows 2018-01-08 17:20:02 -07: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
Gareth J. Greenaway
d834bd1b6f
Fixing some minor lint issues. 2017-12-28 17:07:38 -08:00
Gareth J. Greenaway
4738205154
Fixing a bug when attributes are passed to various osquery module functions. 2017-12-28 17:07:38 -08:00
Erik Johnson
7b13a7df8b
Replace json module usage with a helper to ensure unicode content is handled properly
This adds wrappers for json.dump{,s} which disable `ensure_ascii` by
default.
2017-12-27 09:30:58 -06:00
Erik Johnson
e65237c390
Update test to match how file.append works 2017-12-19 15:34:31 -06:00
Erik Johnson
c6f54ecff4
Make lazydict workaround PY3-compatible 2017-12-19 12:09:36 -06:00
Erik Johnson
387378c4b6
Properly support pillarenv in docker.sls_build 2017-12-19 12:09:35 -06:00
Nicole Thomas
8331d51628
Merge pull request #45041 from terminalmage/add-print_function
[PY3] Add print_function import to files with unicode_literals already added
2017-12-18 11:45:26 -05:00
Nicole Thomas
5bd7854d27
Merge pull request #45042 from rallytime/py3-rsync-tests
Fix a couple of PY3 test failures in the rsync module
2017-12-16 08:18:24 -05:00
Nicole Thomas
04a2ea8cd1
Merge pull request #45019 from rallytime/merge-oxygen
[oxygen] Merge forward from 2017.7 to oxygen
2017-12-16 08:16:57 -05:00
rallytime
ecb1e3cf82
Fix a couple of PY3 test failures in the rsync module
Fixes:
  - unit.modules.test_rsync.RsyncTestCase.test_rsync
  - unit.modules.test_rsync.RsyncTestCase.test_version
2017-12-15 14:32:32 -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
abf34064a1
Merge pull request #44916 from jasperla/status/openbsd/meminfo
status.meminfo: add OpenBSD support
2017-12-15 12:25:56 -05:00
Erik Johnson
239fc8d774
[PY3] Add unicode literals to the clients and associated files/tests 2017-12-15 00:19:55 -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
rallytime
3e319d50b3
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - README.rst
  - salt/modules/win_pkg.py
  - salt/utils/process.py
2017-12-14 13:01:29 -05:00
Jasper Lievisse Adriaanse
5d4d1e29ff
status.meminfo: add OpenBSD support 2017-12-14 18:00:27 +01:00
Nicole Thomas
ae8dd2e202
Merge pull request #44982 from terminalmage/docker-unicode
[PY3] Add unicode_literals to docker state/execution modules
2017-12-14 11:03:15 -05:00
Nicole Thomas
1bd260a663
Merge pull request #44821 from jasperla/status/openbsd/cpuinfo
make status.cpuinfo work on non-FreeBSD
2017-12-14 09:29:27 -05:00
Nicole Thomas
d9a0c02cea
Merge pull request #44877 from terminalmage/os.walk
Replace os.walk with a helper function
2017-12-14 09:09:56 -05:00
Nicole Thomas
95f0be2116
Merge pull request #44950 from gtmanfred/route53
Add Healthcheck for route53 module
2017-12-14 09:02:54 -05:00
Jasper Lievisse Adriaanse
fe7f0b5fcc
status.cpuinfo: unbreak on OpenBSD and add NetBSD support
the field separator on OpenBSD and NetBSD is '=', not ':'.
verified on OpenBSD, assuming this now works on NetBSD based on
upstream documentation for sysctl(8)
2017-12-14 07:56:39 +01:00
Erik Johnson
5e1f75aab0
[PY3] Add unicode_literals to docker state/execution modules 2017-12-13 22:49:23 -06:00
Daniel Wallace
ba98043de9
fix test 2017-12-13 17:18:02 -07: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
Erik Johnson
6d52aeb739
Replace os.walk with a helper function
On PY2, when os.walk is invoked with a str as input, the paths in the
return data are all str types as well. This leaves undecoded unicode
data in those strings when files/dirs under the top dir that was passed
contain unicode characters in the filename.

>>> import os
>>> list(os.walk('temp'))
[('temp', [], ['\xd0\x94.txt', 'foo.txt'])]
>>> list(os.walk(u'temp'))
[(u'temp', [], [u'\u0414.txt', u'foo.txt'])]

The helper introduced here ensures that we always invoke os.walk with a
unicode top-level dir, so that we get unicode types in the return data.
2017-12-13 16:38:12 -06:00
Nicole Thomas
a8fa393459
Merge pull request #44915 from jasperla/status/openbsd/cpustats
status.cpustats: add OpenBSD support
2017-12-13 17:17:43 -05:00
Jasper Lievisse Adriaanse
729422ea41
status.cpustats: add OpenBSD support 2017-12-13 20:21:03 +01:00
Daniel Wallace
2cc8c5541e
fix pylint 2017-12-12 13:50:21 -07:00