Commit graph

33655 commits

Author SHA1 Message Date
Abhijeet Kasurde
3323eecfb0 DigitalOcean: typecast map function for Python3 (#37126)
In Python2, `map` returns list whereas Python3, `map` function
 returns iterator. This fix typecast map function for Python3.

Fixes: #37114

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 8f3f7f104f)
2018-03-29 17:23:44 -07:00
Toshio Kuratomi
d02dd8d8dd changelog for ansible-pull python3 fix 2018-03-29 15:17:17 -07:00
Toshio Kuratomi
133afbaebe Compare byte strings to byte strings
* Fix a traceback in ansible-pull on python3 comparing output from
  subprocess with a text string.
* Rename variables that hold byte strings so we are clear that those are
  not text strings.
* Use to_text() to transform variable that's being displayed as it's
  less fragile than str().

Fixes #36962

(cherry picked from commit b98ad3a12b)
2018-03-29 15:16:51 -07:00
Toshio Kuratomi
783f901919 Add ec2 python3 fix to changelog 2018-03-29 15:15:26 -07:00
Toshio Kuratomi
4beaa03ae6 Fix use of user_data field with spot_price in ec2 module (#37628)
The user_data field is base64 encoded inside of the boto library.  In
Python3, base64 must be used with byte strings.  So we make sure to
encode the user_data into a byte string before passing it on to the boto
library.

Fixes #34978

(cherry picked from commit 0d55081ba8)
2018-03-29 15:14:24 -07:00
Toshio Kuratomi
cf557f0dc1 Add csvfile py3 fix to changelog 2018-03-29 15:13:05 -07:00
Toshio Kuratomi
f7d14a78eb Fix csvfile traceback on Python3 (#37625)
* Fix csvfile traceback on Python3

The csvfile lookup uses some custom iterators.  These needed to be
ported to handle the python3 iterator protocol.  In addition, the
csvfile module takes an iterator of byte strings in Python2 and an
iterator of text strings in Python3

Fixes #36808

(cherry picked from commit 09325b619e)
2018-03-29 15:10:28 -07:00
Toshio Kuratomi
ff2a4eadd8 add haproxy py3 fix 2018-03-29 14:58:53 -07:00
Ravi
8c0b91cdb5 Fix python3 interpreter issue (#34811) (#35176)
* Fix python3 interpreter issue (#34811)

* Update ansible.module_utils._text (#34811)

* Convert to text later to account for multibyte characters

(cherry picked from commit 340064bfb9)
2018-03-29 14:57:54 -07:00
Toshio Kuratomi
c40e62d38f Cherry pick fix for interface_files
https://github.com/ansible/ansible/pull/37818/files
2018-03-29 14:45:12 -07:00
Alvaro Aleman
5d604d7ecd Fix consul module service deregistration (#34847)
* Fix consul module service deregistration

Upstream pr in the python-consul library:
https://github.com/cablehead/python-consul/pull/174

This is based on work from https://github.com/bobh

Fixes ansible/ansible#34628

* Pass ACL token when deregistering consul service

(cherry picked from commit c9cb0016a0)
2018-03-29 14:12:42 -07:00
Matt Martz
b9c94cc0c4 Add changelog entry for #36470 2018-03-28 09:20:42 -07:00
Matt Martz
07449d7e3d Fix py3 issue in wait_for_connection (#37646)
(cherry picked from commit 6c3e565ba3)
2018-03-28 09:20:42 -07:00
Matt Clay
dff97aa252 Fix docker_secret test on RHEL.
(cherry picked from commit f1899f784b)
2018-03-22 12:35:36 -07:00
Matt Clay
03245022a2 Pin httptester SHA.
(cherry picked from commit 8232c95f42)
2018-03-20 12:20:30 -07:00
Matt Clay
a1abc2788d Fix uri test on Python 2.6.
(cherry picked from commit 1fd9a616a4)
2018-03-19 23:19:42 -07:00
Marc Mercer
ff8f3120ef Fixing tab indent on elb_target_group.py example 2018-03-19 16:39:34 -07:00
Toshio Kuratomi
0b0d8a0c03 Add changelog entry for error message wrapping 2018-03-19 08:11:20 -07:00
Pilou
4f071bdc2f Connection error messages are unsafe: wrap them (#37329)
* Check that connection error msg are not unsafe

* Connection error messages are unsafe: wrap them

For example, in case of error, docker connection plugin returns exception
message containing Go template. These messages weren't tagged as unsafe
and were consequently rendered:

The conditional check 'result is failed' failed. The error was:
{
  'msg': u'Docker version check ([\'/usr/bin/docker\', \'version\', \'--format\', "\'{{.Server.Version}}\'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied\n',
  'failed': True
}:
template error while templating string: unexpected '.'.
String: Docker version check (['/usr/bin/docker', 'version', '--format', "'{{.Server.Version}}'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied

(cherry picked from commit 4378542ac7)
2018-03-19 08:10:10 -07:00
Toshio Kuratomi
850224dd5e Add ovirt_vms fix to changelog 2018-03-19 07:59:09 -07:00
Ondra Machacek
2e30e2c8f2 ovirt_vms: Pass correct VM entity to create method (#37460)
(cherry picked from commit 9f02fea15b)
2018-03-19 07:52:19 -07:00
Toshio Kuratomi
0df8924b35 Add openssl_certificate python3 fix to the changelog
(cherry picked from commit 282fbfa7764fee5ec56046d1b248813e42107b6c)
2018-03-19 07:50:40 -07:00
Michael Scherer
0f8b06a8f6 write need bytes object on python 3 (#35143)
Otherwise, it fail with:

    Traceback (most recent call last):
      File \"/tmp/ansible_c1zmq3i9/ansible_module_openssl_certificate.py\", line 808, in <module>
        main()
      File \"/tmp/ansible_c1zmq3i9/ansible_module_openssl_certificate.py\", line 787, in main
        certificate.generate(module)
      File \"/tmp/ansible_c1zmq3i9/ansible_module_openssl_certificate.py\", line 692, in generate
        certfile.write(str(crt))
    TypeError: a bytes-like object is required, not 'str'

(cherry picked from commit 347b5d1e50)
2018-03-19 07:50:40 -07:00
s-hertel
02e591746c Use hyphens in bucket name instead of underscores
As of March 1st underscores are not supported in us-east-1
2018-03-15 13:27:11 -07:00
Matt Clay
7fdc56724a Disable failing github_issue integration test.
(cherry picked from commit 30bb70cf2d)
2018-03-14 16:16:41 -07:00
jjshoe
3fe258e7d5 Document that this module was renamed recently (#37420)
(cherry picked from commit ff15a9e7e2)
2018-03-14 11:37:29 -07:00
Jordan Borean
1f888d9f51 powershell: backport of environment key and value fix 2018-03-08 15:00:37 -08:00
James Mighion
df0f9d1d91 Fixing module docs so they dont show up as a list on ansible docs. (#37203)
* Fixing module docs so they dont show up as a list on ansible docs.

* Fixing spacing in description.
2018-03-08 13:03:20 -08:00
John R Barker
b025f7ea7c yum is Python 2 only. If Python 3 use dnf (#37140)
* PY3 = dnf

Red Hat are unlikely to provide a Python 2 version of the yum bindings
as they are moving to `dnf`.

If Ansible can't find the yum Python library give the user a hint about
dnf and Python 3

(cherry picked from commit 6c8d40f653)
2018-03-08 00:37:25 -08:00
Toshio Kuratomi
3667a0d1cc Add unarchive fix to changelog 2018-03-07 18:43:21 -08:00
Toshio Kuratomi
c37e2e5d6e Fix unarchive with strip-components in extra_opts (#37048)
* Fix unarchive with strip-components in extra_opts

When unarchive is given extra_opts to strip all leading directories, it
could end up trying to change the permissions on the root directory.
Tar archives shouldn't contain absolute paths anyways so make sure that
all paths are relative as we handle them.

Fixes #21397

(cherry picked from commit cca0ccaf97)
2018-03-07 18:42:44 -08:00
Matt Martz
7264d13991 Backport #37151 for 2.4 (#37153)
* Add ansible-config and ansible-inventory to setup.py scripts (#37151)

(cherry picked from commit bd43776acf)

* Add changelog entry for #37151
2018-03-07 15:02:00 -08:00
Toshio Kuratomi
3bf0a50716 Clarify docker SDK rather than docker API 2018-03-06 09:01:15 -08:00
Toshio Kuratomi
87c11663c1 Add docker 3 API fixes to the changelog 2018-03-06 07:01:35 -08:00
skylerbunny
d6f150cbb8 Add compatibility for docker-py version 3 (#36973)
(cherry picked from commit d984afa5ba)
2018-03-06 06:58:09 -08:00
Toshio Kuratomi
612b99a217 Add py3 znode and maven_artifact fixes to the changelog 2018-03-05 18:50:23 -08:00
Toshio Kuratomi
e0bc936b56 Python3 issues in maven_artifact (#37035)
Fixes #33761

(cherry picked from commit 1bc860fafd)
2018-03-05 18:49:48 -08:00
Grigory Starinkin
98b5ffec04 fix python3 compatibility for znode module
kazoo client requires bytes and not string

(cherry picked from commit 2d98a2de68)
2018-03-05 13:02:40 -08:00
David Newswanger
5911ee813a fix python 3 dictionary issue 2018-03-05 09:07:27 -08:00
Toshio Kuratomi
5328bfd99b New release v2.4.4-0.2.rc1 2018-03-01 13:50:04 -08:00
Sam Doran
47eccd366b
Cherry pick Tower credential fixes to stable-2.4 (#36807)
* Fix credentials for Tower API V2

(cherry picked from commit 640749d54f)

* tower cred: implement credential /api/v1/ kind compatability

(cherry picked from commit 9cb4b70e27)

* tower cred: filter user name lookup by the proper key

(cherry picked from commit cd6855275e)

* tower cred: update kind options in documentation

(cherry picked from commit 8a41233202)

* tower cred: support credential kind/type for /api/v1/ and /api/v2/ (#36662)

older versions of Tower (3.1) don't have a concept of CredentialTypes
(this was introduced in Tower 3.2).  This change detects older versions
of pre-3.2 tower-cli that *only* support the deprecated `kind`
attribute.

(cherry picked from commit 641f8b4ef6)

* Add CHANGELOG entry for Ansible Tower module credential fix

* properly detect the absence of credential_type in older tower-cli (#36908)

(cherry picked from commit a82043939b)

* Do not import HAS_TOWER_CLI since it does not exist in stable-2.4

* properly pass /api/v1/ credential fields for older Towers (#36917)

(cherry picked from commit 0e7106b106)
2018-03-01 15:54:15 -05:00
Brian Coca
0d57282a1a remove extra fields from debug output
fixes #35493

updated tests

(cherry picked from commit a79378fccb)
2018-03-01 12:06:40 -05:00
Brian Coca
4546e7d1d7 fix loop_control templating (#36124)
* fix loop_control templating

- properly template ALL properites for loop_control
- loop_control inherits from base, it should not, but needs validate/attribute functionality

fixes #24719

(cherry picked from commit 8de4f7cd9f)
2018-03-01 11:53:19 -05:00
Toshio Kuratomi
990254efb1 Add protection for inventory plugins using verify incorrectly to changelog 2018-02-28 19:07:19 -08:00
Brian Coca
18359b0cec protect against plugins using verify incorrectly
assume false on any errors

(cherry picked from commit ef40e5e3b2)
2018-02-28 19:06:27 -08:00
Trishna Guha
92cea82a4e
vyos_l3_interface fix (#36721)
* vyos_l3_interface fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* update test and changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-02-27 08:52:37 +05:30
Matt Clay
2d05ecb26c Temporarily disable subversion test on osx.
(cherry picked from commit f283edcb19)
2018-02-26 13:26:35 -08:00
Matt Clay
1f43d5fc75 Fix rst link syntax. 2018-02-26 11:31:55 -08:00
Matt Clay
29e7d5ecd9 Fix unclosed anchor in changelog. 2018-02-26 10:08:10 -08:00
Matt Martz
668a17cfba
Backport #36602 for stable-2.4 (#36607)
* Start of tests for modify_module, specifically to ensure proper shebang replacement on old style modules (#36602)

(cherry picked from commit a7062b7587)

* Modify test to work on 2.4 due to lacking templar kwarg
2018-02-22 17:52:47 -06:00