Commit Graph

90743 Commits

Author SHA1 Message Date
Bo Maryniuk
b24a8c3653 Use salt.utils.platform for OS detection 2018-02-20 18:36:27 +01:00
Nicole Thomas
a422f3762b
Merge pull request #46081 from Ch3LL/mac-locale
Patch salt.utils call for test_parse_localectl test
2018-02-20 12:13:07 -05:00
Nicole Thomas
3ec27a6b67
Merge pull request #46075 from rallytime/bp-46066-oxygen.rc1
Back-port #46066 to oxygen.rc1
2018-02-20 12:12:30 -05:00
Nicole Thomas
23f0f0ca54
Merge pull request #46083 from terminalmage/issue46020
Remove object_hook usage from (almost) all json loading
2018-02-20 12:11:24 -05:00
Bo Maryniuk
98cb94ae73 Update unit test on ignoring logging while file do not exist 2018-02-20 16:47:05 +01:00
Bo Maryniuk
2e76606edf Update unit test for catching out permission error 2018-02-20 16:46:43 +01:00
Bo Maryniuk
82ad57f104 Fix typo 2018-02-20 16:46:21 +01:00
Bo Maryniuk
e61315c956 Update unit test to handle OSError exception 2018-02-20 16:28:00 +01:00
Bo Maryniuk
bba2b93e79 Remove double-stating file while generating grains 2018-02-20 16:24:31 +01:00
Bo Maryniuk
8aa0e83be6 Refactor unit test for simplicity so it does not need to be splitted in two functions 2018-02-20 15:25:54 +01:00
Bo Maryniuk
8320939f5e Add pytest 2018-02-20 15:25:19 +01:00
Bo Maryniuk
3015ed6bcb Fix unit test for testing main functionality of linux_iqn 2018-02-20 15:18:21 +01:00
Bo Maryniuk
2aa4d02677 Add unit test for linux_iqn testing, if not iscsii available 2018-02-20 15:10:11 +01:00
Bo Maryniuk
a2ba9377f6 Add unit test for grains linux_iqn when running as non-root 2018-02-20 15:03:59 +01:00
Bo Maryniuk
0df31e9e19 Handle access denied error when Master is not running as root 2018-02-20 15:03:25 +01:00
Dmitry Kuzmenko
e35bdb39d1
M2Crypto py3 unicode related fixes 2018-02-19 19:23:51 +03:00
Bo Maryniuk
43026b67da Add unit test for x509 module on function _parse_subject 2018-02-19 15:53:42 +01:00
Bo Maryniuk
efb18b87a9 Add logging to the subject parsing 2018-02-19 15:53:06 +01:00
Nicole Thomas
0e8f476a01
Merge pull request #46080 from terminalmage/salt-jenkins-844
Correct the version number in upstream pygit2 workaround
2018-02-16 16:53:52 -05:00
Erik Johnson
03b0591f06
Remove object_hook usage from (almost) all json loading
To explain this change, it's necessary to first understand the history
of `object_hook` usage in Salt.

Initially, the function used as the object hook wherever we used it was
(incorrectly) named `encode_dict`, despite the fact that the code was
*decoding* the contents of the dictionary to unicode. This function was
renamed to `decode_dict`, and a counterpart which *actually* encodes was
put in its place. At this time *most* of the `object_hook` usage was
changed so that `decode_dict` was used, but some references were left
using `encode_dict` (likely because I wasn't sure whether or not
changing them would break things).

However, if the desire is to have unicode values after loading JSON,
there is actually no need to use an object hook, since loading JSON in
Python always produces unicode results even with a POSIX locale!

[root@2719cd6224d3 /]# locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
[root@2719cd6224d3 /]# python
Python 2.7.5 (default, Nov  6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> json.loads('{"foo": "bar"}')
{u'foo': u'bar'}
>>> json.loads('{"foo": "Д"}')
{u'foo': u'\u0414'}
>>>

Therefore, this commit removes all `object_hook` usage where
`decode_dict` was the hook being used, since it is redundant. It also
removes one use of `encode_dict` as an object hook that was still left
in code used by salt-thin.

The only `object_hook` left is in some of our ioflo code. I left the
`encode_dict` there, but _only for Python 2_, because if I remember
correctly ioflo needs str types, and encoding a string in Python 2
produces a str type.
2018-02-16 14:55:42 -06:00
Ch3LL
edc6243d1c
Patch salt.utils call for test_parse_localectl test 2018-02-16 15:26:06 -05:00
Nicole Thomas
f09db38f63
Merge pull request #46072 from rallytime/bp-46056
Back-port #46056 to oxygen.rc1
2018-02-16 14:56:56 -05:00
Erik Johnson
7b89dbb22b
Correct the version number in upstream pygit2 workaround
I used the incorrect version in my upstream bug workaround in #45892,
I missed that there was a 0.26.3 released before the bugfix was made.
This corrects that, and also fixes an incomplete comment that trailed
off in the middle of the sentence.
2018-02-16 13:21:45 -06:00
rallytime
e0a419655b
Pin tornado version in requirements file
tornado needs to be >= 4.2.1, but less that 5.0.

Tornado 5.0 is introducing backwards-incompatible changes. Therefore,
we need to pin the version of tornado in base.txt until we can fix
supporting Tornado 5.0 in Salt.

Refs #45790
2018-02-16 12:05:44 -05:00
Erik Johnson
b616ce046b
Add clarifying comments 2018-02-16 10:22:23 -06:00
Ch3LL
bd3a73dd04
Fix mac_assistive module not loading 2018-02-16 10:52:18 -05:00
rallytime
144b29f68b
Update old utils paths to new paths for oxygen 2018-02-16 10:35:22 -05:00
Bo Maryniuk
e286d6a45f Remove unnecessary variable 2018-02-16 16:33:48 +01:00
rallytime
9dfbdd1d97
Make sure ssh utils update has oxygen/unicode fixes 2018-02-16 10:33:42 -05:00
Erik Johnson
149e9edf8c
Mock the ssh.key_is_encrypted utils func 2018-02-16 10:29:30 -05:00
Erik Johnson
2a1834560d
Move ssh.key_is_encrypted to a utils module temporarily
This allows us to expose the needed functionality to Windows in the
meantime while we work to get salt/modules/ssh.py importing on Windows
for the Fluorine release.
2018-02-16 10:29:29 -05:00
twangboy
ebe3dd0d3e
Only keep ssh.py in the Windows installer 2018-02-16 10:28:10 -05:00
twangboy
789b3afbdf
Keep ssh state and execution modules in the installer 2018-02-16 10:28:10 -05:00
Erik Johnson
3fac72431f
git.latest: Fix regression with identity file usage
Unit test included
2018-02-16 10:25:25 -05:00
Bo Maryniuk
7461ed3c3b Lintfix: E0203 and attribute access 2018-02-16 15:03:52 +01:00
Bo Maryniuk
5d1740e4a0 Install ZMQ handler if <15 version 2018-02-16 13:56:38 +01:00
Erik Johnson
2035bc8a44
Use unicode normalization to make test work on MacOS 2018-02-15 20:27:44 -06:00
Erik Johnson
e9ddce6e26
Update unit tests to test new unicode normalization support 2018-02-15 20:27:44 -06:00
Erik Johnson
b4e30f3804
Add unicode normalization support to data/stringutils helpers
This allows for optional normalization of unicode strings, which will
make testing more reliable. In Mac OS, os.listdir() will produce certain
unicode glyphs using separate code points for the base character and
diacritic mark, while others will use a single code point to represent
the same unicode glyph.

>>> a = u'\u0065\u0301'
>>> b = u'\u00e9'
>>> print(a)
é
>>> print(b)
é
>>> a == b
False
>>> import salt.utils.stringutils
>>> salt.utils.stringutils.to_unicode(a, normalize=True) == b
True
>>>
2018-02-15 20:27:39 -06:00
Nicole Thomas
005539923f
Merge pull request #45811 from gtmanfred/oxygen.rc1
Fix ldap eauth
2018-02-15 14:04:47 -05:00
Nicole Thomas
cb565b1520
Merge pull request #46039 from terminalmage/fix-duplicate-extra-opts-oxygen.rc1
Port #45991 to Oxygen.rc1
2018-02-15 13:53:52 -05:00
Nicole Thomas
04d73142fa
Merge pull request #46038 from rallytime/bp-46000
Back-port #46000 to oxygen.rc1
2018-02-15 11:10:47 -05:00
Bo Maryniuk
48b40eede9 Use ZMQ switch utility in the integration tests 2018-02-15 14:04:45 +01:00
Bo Maryniuk
85ef89c993 Use ZMQ_VERSION_INFO constant everywhere 2018-02-15 10:33:25 +01:00
Bo Maryniuk
1099ac1afa Add trace logging on ZMQ sockets communication 2018-02-15 10:18:46 +01:00
Bo Maryniuk
98a630e874 Remove duplicate code for ZMQ monitor handling 2018-02-15 10:18:26 +01:00
Bo Maryniuk
741bec031a Remove obsolete ZMQIOLoop direct instance 2018-02-15 10:02:22 +01:00
David Murphy
da2fc81e2e
Merge pull request #46035 from terminalmage/distutils-fix
setup.py: Work around bad code in distutils
2018-02-14 17:12:25 -07:00
David Murphy
f91289ed3b
Merge branch 'oxygen.rc1' into distutils-fix 2018-02-14 15:08:45 -07:00
Erik Johnson
160dcc4ca0
Appease pylint 2018-02-14 14:52:22 -06:00