Commit graph

21163 commits

Author SHA1 Message Date
James Cammarata
c92ce0c2ca Fix bug introduced in 0df3767 regarding undefined entries in HostVars
Fixes #21084

(cherry picked from commit eec88b63c2)
2017-02-15 16:23:24 -06:00
Toshio Kuratomi
1262e5fdca Fix hash filter for non-ascii strings and Python3
hashlib hashes operate on byte strings.  When given a text string on
Python3, hashlib backtraces.  When given a text string on Python2,
hashlib will backtrace if the string contains non-ascii characters.
Encode the text string to utf-8 prior to hashing to avoid this problem.

Fixes #21452

(cherry picked from commit 99fd2328af)
2017-02-15 11:59:42 -08:00
Matt Clay
cb93ecaef9 Fix @contextmanager leak on exception. (#21031)
* Fix @contextmanager leak on exception.
* Fix test leaks of global module args cache.

(cherry picked from commit 272ff10fa1)
2017-02-15 11:57:16 -08:00
James Cammarata
6176c95838 Also clean template data even if marked unsafe
Fixes #20568

(cherry picked from commit 86beb55a90)
2017-02-10 10:09:50 -06:00
Brian Coca
ef24d56c8f removed warn, which is added in 2.3
(cherry picked from commit 68dbed2a5e)
2017-02-10 08:31:22 -05:00
Brian Coca
f1217a9b94 use regex vs list to weed out password fields
- also warn as module SHOULD have no_log
 - make password regex exportable for testing
 - avoids boolean fields

(cherry picked from commit 403e9d35df)
2017-02-09 18:18:48 -05:00
Matt Davis
9029547603 bump submodule refs 2017-02-09 11:27:12 -08:00
Brian Coca
81e96c754a add url_password to 'cleanse' list
(cherry picked from commit 2f1ab29855)
2017-02-09 08:53:50 -05:00
jerry
c4b09cbcb4 removing unwanted variables and using to_native instead of str() 2017-02-08 15:53:19 -05:00
jeronimog
ef1ecfd2c2 Adding self.log() on IOErrors and OSErrros 2017-02-08 15:53:19 -05:00
Matt Clay
39acdde5aa Use older setuptools for sanity tests. 2017-02-06 14:53:05 -08:00
Toshio Kuratomi
7b2fcb2d4e Make sure that we're comparing text all the way through.
On Darwin, sys.platform returns byte strings on both python2 and
python3.  Turn it into a text string everywhere in order to remedy that.

Fixes #19845

(cherry picked from commit bfffd1952f)
2017-02-06 13:10:25 -08:00
Eugene Krokhalev
4e257fad84 [cloud] unicode is absent on Python 3, use text_type (#20861) 2017-02-03 16:34:52 -05:00
Toshio Kuratomi
3551de98c6 Split on newlines when checking for prompt matches (#20945)
* Check for the prompt as a substring of the output

sudo sometimes spits out warnings to stdout before getting to the
password prompt.  Account for that when trying to match a password
prompt.

Fixes #20858
(cherry picked from commit fee6e2953b)
2017-02-02 14:31:58 -08:00
Toshio Kuratomi
a0104cfe81 Do not substitute ssh_exeuctable until we need to
We need to use ssh_executable instead of hardcoding ssh in the command
we run but we need to use "ssh" when we lookup the value of the
{command}_extra_args variable.  Do this by leaving binary as "ssh" and
only expanding when we place it into b_command.

Fixes #20862

(cherry picked from commit 62ba084003)
2017-02-02 13:44:55 -08:00
Toshio Kuratomi
5f5d143194 Fix import of urlparse on python3
Should fix the error reported here:
https://github.com/ansible/ansible/issues/17495#issuecomment-267921719

(cherry picked from commit 4f960a4f42)
2017-01-30 09:44:04 -08:00
Peter Oliver
04b2e1fbc0 Fix setup on Solaris 8 and 9 (#20780)
Neither the `virtinfo` nor `smbios` commands exist on these systems, which was causing `setup` to fail with the error `Argument 'args' to run_command must be list or string`.
2017-01-27 17:46:45 -05:00
Brian Coca
65ee9d2e46 only ignore become for making tmpdir 2017-01-26 15:18:10 -05:00
Brian Coca
75de5737f7 fix improper setting become user for tmpdir
fixes #20706

(cherry picked from commit 0a8b856102)
2017-01-26 14:39:49 -05:00
Brian Coca
21106cc95b fix powershell mkdtemp
(cherry picked from commit 9e0fd313d7)
2017-01-25 13:19:51 -05:00
Brian Coca
89fdca0929 make sure tmpdir resolvs user dirs (#20486)
* make sure tmpdir resolvs user dirs

fixes #20332
supercedes #20484

* typo fix

(cherry picked from commit 10fa2cd0ef)
2017-01-25 13:19:51 -05:00
Matt Martz
7164956cc6 Add jinja2 groupby filter override to cast namedtuple to tuple. Fixes #20098 (#20362)
* Add jinja2 groupby filter override to cast namedtuple to tuple. Fixes #20098

* Address some of the requested changes

* Quoting

* Print the python path and version

* Be less explicitly verbose, rely on implicit verbosity
2017-01-19 12:23:03 -08:00
Matt Clay
0240ffe220 Disable pull of updated Shippable docker image.
This should improve reliability of our jobs on Shippable.

The Shippable AMIs should already have the latest docker image,
per Shippable support, so pull doesn't provide any benefit for us.

(cherry picked from commit 25caa67d41)
2017-01-19 11:45:35 -08:00
Matt Clay
db22594955 Update test to use keyserver.ubuntu.com.
(cherry picked from commit 4d616366c0)
2017-01-19 11:39:39 -08:00
Matt Clay
9e9d202d6f Use jinja2 import instead of pip to get version.
This resolves issues with older versions of pip.

(cherry picked from commit a8fb6f0958)
2017-01-19 11:07:43 -08:00
Matt Clay
b2942f1084 Only test map on jinja2 >= 2.7
(cherry picked from commit ad65274643)
2017-01-19 09:01:25 -08:00
Toshio Kuratomi
26f5e4b32d Fix linenos being wrong in inventory errors
Fixes #20356

(cherry picked from commit 05879d331a)
2017-01-19 08:41:05 -08:00
James Cammarata
e85f3f4461 Add representer to AnsibleDumper for AnsibleUnsafeText
Fixes #20253
Fixes #20290
2017-01-19 10:12:22 -06:00
James Cammarata
f4ecbc4c3f Fixing iterator bug related to reworking of end-of-role detection
Bug was introduced in cae682607

(cherry picked from commit 9d549c3498)
2017-01-19 10:11:52 -06:00
James Cammarata
b12256acf2 Reworking the way end of role detection is done
Rather than trying to enumerate tasks or track an ever changing cur_role
flag in PlayIterator, this change simply sets a flag on the last block in
the list of blocks returned by Role.compile(). The PlayIterator then checks
for that flag when the cur_block number is incremented, and marks the role
as complete if the given host had any tasks run in that role.

Fixes #20224

(cherry picked from commit cae682607c)
2017-01-19 10:11:44 -06:00
Toshio Kuratomi
f649a87a19 Remove restriction on maximum jinja2 version as we're hoping the next release will work with jinja2-2.9 2017-01-16 11:24:22 -08:00
James Cammarata
2f0dba4f36 Fix for bug in Conditional for older jinja2 versions
Fixes #20309

(cherry picked from commit af96cba7e1)
2017-01-16 13:17:06 -06:00
Toshio Kuratomi
6a9572e1e5 Update submodule refs 2017-01-16 11:11:25 -08:00
James Cammarata
5362910000 New release v2.2.1.0-1 2017-01-16 10:13:31 -06:00
James Cammarata
009ac7b65e Forgot to add the release date to the CHANGELOG 2017-01-16 09:59:06 -06:00
James Cammarata
c6ef74d81b Updating CHANGELOG 2017-01-16 09:51:22 -06:00
James Cammarata
0c153146e3 New release v2.2.1.0-0.5.rc5 2017-01-13 16:44:45 -06:00
James Cammarata
86eadc5814 Additional security fixes for CVE-2016-9587
(cherry picked from commit b7cdc21aee)
2017-01-13 16:23:14 -06:00
Brian Coca
4b495d7e43 fix issue when proc read returns None
fixes #20225
2017-01-13 14:06:11 -05:00
Matt Clay
c846e915f8 Correct freebsd startup test for CI. 2017-01-13 10:03:11 -08:00
Matt Clay
a93e7506a8 Test with jinja2 < 2.9. 2017-01-12 14:00:39 -08:00
Brian Coca
49fc0cfe4f deal with remote_src and tmp dirs properly
fixes #20128

(cherry picked from commit 8c6b5621f8)
2017-01-12 14:10:16 -05:00
Brian Coca
d1c5a39420 ansible doc does not need plugin deprecation error
(cherry picked from commit 74421f42e1)
2017-01-12 13:10:44 -05:00
Toshio Kuratomi
06ed25e788 Add jinja2 version constraint.
We're not yet compatible with jinja2-2.9 so help out people using pip to
install to get a working installation.
2017-01-12 10:01:29 -08:00
James Cammarata
b3daa9dd64 New release v2.2.1.0-0.4.rc4 2017-01-11 16:25:28 -06:00
James Cammarata
6dee2b21e6 Partial revert of 76f7ce55
(cherry picked from commit a94a48f85f)
2017-01-11 15:53:39 -06:00
James Cammarata
cc4634a5e7 Additional fixes for security related to CVE-2016-9587
(cherry picked from commit d316068831)
2017-01-11 15:53:38 -06:00
Computest
eb8c26c105 Fixing another corner case for security related to CVE-2016-9587
(cherry picked from commit bcceada5d9)
2017-01-11 15:53:37 -06:00
Marius Gedminas
240c388e6c Fix a test failure on Python 3.6 (#20030)
* Fix a test failure on Python 3.6

tox -e py36 failed with

    ======================================================================
    ERROR: test_action_base__execute_module (units.plugins.action.test_action.TestActionBase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/mg/src/ansible/test/units/plugins/action/test_action.py", line 507, in test_action_base__execute_module
        self.assertEqual(action_base._execute_module(), dict(_ansible_parsed=True, rc=0, stdout="ok", stdout_lines=['ok']))
      File "/home/mg/src/ansible/lib/ansible/plugins/action/__init__.py", line 596, in _execute_module
        remote_module_path = self._connection._shell.join_path(tmp, remote_module_filename)
      File "/home/mg/opt/python36/lib/python3.6/unittest/mock.py", line 939, in __call__
        return _mock_self._mock_call(*args, **kwargs)
      File "/home/mg/opt/python36/lib/python3.6/unittest/mock.py", line 1005, in _mock_call
        ret_val = effect(*args, **kwargs)
      File "/home/mg/src/ansible/.tox/py36/lib/python3.6/posixpath.py", line 92, in join
        genericpath._check_arg_types('join', a, *p)
      File "/home/mg/src/ansible/.tox/py36/lib/python3.6/genericpath.py", line 149, in _check_arg_types
        (funcname, s.__class__.__name__)) from None
    TypeError: join() argument must be str or bytes, not 'MagicMock'

because os.path.join() now checks argument types since Python 3.6 (due
to pathlib support, I expect).

* Use a more realistic module name in test

(cherry picked from commit d9b89ca577)
2017-01-10 07:37:36 -08:00
Matt Clay
941552d107 Fix group_by test to work with jinja2 >= 2.9.
(cherry picked from commit cc3d131f50)
2017-01-09 15:26:52 -08:00