diff --git a/v2/ansible/executor/playbook_executor.py b/v2/ansible/executor/playbook_executor.py
index 8af19ed378..6f0bf31f33 100644
--- a/v2/ansible/executor/playbook_executor.py
+++ b/v2/ansible/executor/playbook_executor.py
@@ -16,7 +16,7 @@
# along with Ansible. If not, see .
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import signal
diff --git a/v2/ansible/inventory/__init__.py b/v2/ansible/inventory/__init__.py
index c8e3cddeba..063398f17f 100644
--- a/v2/ansible/inventory/__init__.py
+++ b/v2/ansible/inventory/__init__.py
@@ -16,6 +16,9 @@
# along with Ansible. If not, see .
#############################################
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import fnmatch
import os
import sys
diff --git a/v2/ansible/inventory/dir.py b/v2/ansible/inventory/dir.py
index 52f7af8b53..73c882f288 100644
--- a/v2/ansible/inventory/dir.py
+++ b/v2/ansible/inventory/dir.py
@@ -17,6 +17,8 @@
# along with Ansible. If not, see .
#############################################
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
diff --git a/v2/ansible/inventory/expand_hosts.py b/v2/ansible/inventory/expand_hosts.py
index f129740935..b5a957c53f 100644
--- a/v2/ansible/inventory/expand_hosts.py
+++ b/v2/ansible/inventory/expand_hosts.py
@@ -30,6 +30,9 @@ expanded into 001, 002 ...009, 010.
Note that when beg is specified with left zero padding, then the length of
end must be the same as that of beg, else an exception is raised.
'''
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import string
from ansible import errors
diff --git a/v2/ansible/inventory/group.py b/v2/ansible/inventory/group.py
index 87d6f64dfc..6525e69b46 100644
--- a/v2/ansible/inventory/group.py
+++ b/v2/ansible/inventory/group.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.utils.debug import debug
diff --git a/v2/ansible/inventory/ini.py b/v2/ansible/inventory/ini.py
index 4236140ac8..e004ee8bb7 100644
--- a/v2/ansible/inventory/ini.py
+++ b/v2/ansible/inventory/ini.py
@@ -16,6 +16,8 @@
# along with Ansible. If not, see .
#############################################
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import ast
import shlex
diff --git a/v2/ansible/inventory/script.py b/v2/ansible/inventory/script.py
index 13b53a24f5..9675d70f69 100644
--- a/v2/ansible/inventory/script.py
+++ b/v2/ansible/inventory/script.py
@@ -16,6 +16,8 @@
# along with Ansible. If not, see .
#############################################
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import subprocess
diff --git a/v2/ansible/inventory/vars_plugins/noop.py b/v2/ansible/inventory/vars_plugins/noop.py
index 5d4b4b6658..8f0c98cad5 100644
--- a/v2/ansible/inventory/vars_plugins/noop.py
+++ b/v2/ansible/inventory/vars_plugins/noop.py
@@ -15,6 +15,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
class VarsModule(object):
diff --git a/v2/ansible/parsing/utils/jsonify.py b/v2/ansible/parsing/utils/jsonify.py
index 37c97d0195..59dbf9f8c4 100644
--- a/v2/ansible/parsing/utils/jsonify.py
+++ b/v2/ansible/parsing/utils/jsonify.py
@@ -1,4 +1,23 @@
-# FIXME: header
+# (c) 2012-2014, Michael DeHaan
+#
+# This file is part of Ansible
+#
+# Ansible is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Ansible is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Ansible. If not, see .
+
+# Make coding more python3-ish
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
try:
import json
diff --git a/v2/ansible/playbook/helpers.py b/v2/ansible/playbook/helpers.py
index 7242322b88..92f1c64c83 100644
--- a/v2/ansible/playbook/helpers.py
+++ b/v2/ansible/playbook/helpers.py
@@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
diff --git a/v2/ansible/playbook/play.py b/v2/ansible/playbook/play.py
index 33fd5efd9f..c7f89888b8 100644
--- a/v2/ansible/playbook/play.py
+++ b/v2/ansible/playbook/play.py
@@ -16,7 +16,7 @@
# along with Ansible. If not, see .
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError, AnsibleParserError
diff --git a/v2/ansible/plugins/action/assemble.py b/v2/ansible/plugins/action/assemble.py
index 638d4b92bb..4e796bddb6 100644
--- a/v2/ansible/plugins/action/assemble.py
+++ b/v2/ansible/plugins/action/assemble.py
@@ -15,6 +15,8 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import os.path
diff --git a/v2/ansible/plugins/action/assert.py b/v2/ansible/plugins/action/assert.py
index 7204d93875..5c4fdd7b89 100644
--- a/v2/ansible/plugins/action/assert.py
+++ b/v2/ansible/plugins/action/assert.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.errors import AnsibleError
from ansible.playbook.conditional import Conditional
diff --git a/v2/ansible/plugins/action/async.py b/v2/ansible/plugins/action/async.py
index 6fbf93d61f..7c02e09757 100644
--- a/v2/ansible/plugins/action/async.py
+++ b/v2/ansible/plugins/action/async.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import json
import random
diff --git a/v2/ansible/plugins/action/debug.py b/v2/ansible/plugins/action/debug.py
index dcee3e6347..dc80dfc179 100644
--- a/v2/ansible/plugins/action/debug.py
+++ b/v2/ansible/plugins/action/debug.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.plugins.action import ActionBase
from ansible.utils.boolean import boolean
diff --git a/v2/ansible/plugins/action/fail.py b/v2/ansible/plugins/action/fail.py
index a95ccb32f7..b7845c95c5 100644
--- a/v2/ansible/plugins/action/fail.py
+++ b/v2/ansible/plugins/action/fail.py
@@ -15,6 +15,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.plugins.action import ActionBase
diff --git a/v2/ansible/plugins/action/fetch.py b/v2/ansible/plugins/action/fetch.py
index 7b549f5ecb..58e7cebb8d 100644
--- a/v2/ansible/plugins/action/fetch.py
+++ b/v2/ansible/plugins/action/fetch.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import pwd
diff --git a/v2/ansible/plugins/action/group_by.py b/v2/ansible/plugins/action/group_by.py
index 50e0cc09c4..95db33aa43 100644
--- a/v2/ansible/plugins/action/group_by.py
+++ b/v2/ansible/plugins/action/group_by.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.errors import *
from ansible.plugins.action import ActionBase
diff --git a/v2/ansible/plugins/action/include_vars.py b/v2/ansible/plugins/action/include_vars.py
index 345e0edc0e..8a7a74d870 100644
--- a/v2/ansible/plugins/action/include_vars.py
+++ b/v2/ansible/plugins/action/include_vars.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
diff --git a/v2/ansible/plugins/action/normal.py b/v2/ansible/plugins/action/normal.py
index 66721b4eb2..431d9b0eeb 100644
--- a/v2/ansible/plugins/action/normal.py
+++ b/v2/ansible/plugins/action/normal.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.plugins.action import ActionBase
diff --git a/v2/ansible/plugins/action/pause.py b/v2/ansible/plugins/action/pause.py
index c56e6654b1..c5a97d5366 100644
--- a/v2/ansible/plugins/action/pause.py
+++ b/v2/ansible/plugins/action/pause.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import datetime
import sys
@@ -99,7 +101,7 @@ class ActionModule(ActionBase):
try:
if not pause_type == 'prompt':
- print "(^C-c = continue early, ^C-a = abort)"
+ print("(^C-c = continue early, ^C-a = abort)")
#print("[%s]\nPausing for %s seconds" % (hosts, seconds))
print("[%s]\nPausing for %s seconds" % (self._task.get_name().strip(), seconds))
time.sleep(seconds)
@@ -110,7 +112,7 @@ class ActionModule(ActionBase):
result['user_input'] = raw_input(prompt.encode(sys.stdout.encoding))
except KeyboardInterrupt:
while True:
- print '\nAction? (a)bort/(c)ontinue: '
+ print('\nAction? (a)bort/(c)ontinue: ')
c = getch()
if c == 'c':
# continue playbook evaluation
diff --git a/v2/ansible/plugins/action/raw.py b/v2/ansible/plugins/action/raw.py
index d1d1b28056..f9cd56572b 100644
--- a/v2/ansible/plugins/action/raw.py
+++ b/v2/ansible/plugins/action/raw.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.plugins.action import ActionBase
diff --git a/v2/ansible/plugins/action/script.py b/v2/ansible/plugins/action/script.py
index 21a9f41c59..3ca7dc6a34 100644
--- a/v2/ansible/plugins/action/script.py
+++ b/v2/ansible/plugins/action/script.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
diff --git a/v2/ansible/plugins/action/set_fact.py b/v2/ansible/plugins/action/set_fact.py
index bf89e7ec51..a7ddf10b47 100644
--- a/v2/ansible/plugins/action/set_fact.py
+++ b/v2/ansible/plugins/action/set_fact.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.errors import AnsibleError
from ansible.plugins.action import ActionBase
diff --git a/v2/ansible/plugins/action/synchronize.py b/v2/ansible/plugins/action/synchronize.py
index 81e335b009..1bc64ff4d5 100644
--- a/v2/ansible/plugins/action/synchronize.py
+++ b/v2/ansible/plugins/action/synchronize.py
@@ -15,6 +15,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os.path
diff --git a/v2/ansible/plugins/action/template.py b/v2/ansible/plugins/action/template.py
index f82cbb3766..a234ef2eee 100644
--- a/v2/ansible/plugins/action/template.py
+++ b/v2/ansible/plugins/action/template.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import base64
import os
diff --git a/v2/ansible/plugins/action/unarchive.py b/v2/ansible/plugins/action/unarchive.py
index 1b6cb354f0..b7601ed910 100644
--- a/v2/ansible/plugins/action/unarchive.py
+++ b/v2/ansible/plugins/action/unarchive.py
@@ -15,6 +15,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import pipes
diff --git a/v2/ansible/plugins/cache/__init__.py b/v2/ansible/plugins/cache/__init__.py
index deed7f3ecd..4aa8fda8bb 100644
--- a/v2/ansible/plugins/cache/__init__.py
+++ b/v2/ansible/plugins/cache/__init__.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from collections import MutableMapping
diff --git a/v2/ansible/plugins/cache/base.py b/v2/ansible/plugins/cache/base.py
index b6254cdfd4..6ff3d5ed1e 100644
--- a/v2/ansible/plugins/cache/base.py
+++ b/v2/ansible/plugins/cache/base.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import exceptions
diff --git a/v2/ansible/plugins/cache/memcached.py b/v2/ansible/plugins/cache/memcached.py
index deaf07fe2e..e7321a5a6b 100644
--- a/v2/ansible/plugins/cache/memcached.py
+++ b/v2/ansible/plugins/cache/memcached.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import collections
import os
@@ -28,7 +30,7 @@ from ansible.plugins.cache.base import BaseCacheModule
try:
import memcache
except ImportError:
- print 'python-memcached is required for the memcached fact cache'
+ print('python-memcached is required for the memcached fact cache')
sys.exit(1)
diff --git a/v2/ansible/plugins/cache/memory.py b/v2/ansible/plugins/cache/memory.py
index 007719a647..1562836151 100644
--- a/v2/ansible/plugins/cache/memory.py
+++ b/v2/ansible/plugins/cache/memory.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.plugins.cache.base import BaseCacheModule
diff --git a/v2/ansible/plugins/cache/redis.py b/v2/ansible/plugins/cache/redis.py
index 7f126de64b..287c14bd2a 100644
--- a/v2/ansible/plugins/cache/redis.py
+++ b/v2/ansible/plugins/cache/redis.py
@@ -14,9 +14,9 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
-from __future__ import absolute_import
-import collections
# FIXME: can we store these as something else before we ship it?
import sys
import time
@@ -28,7 +28,7 @@ from ansible.plugins.cache.base import BaseCacheModule
try:
from redis import StrictRedis
except ImportError:
- print "The 'redis' python module is required, 'pip install redis'"
+ print("The 'redis' python module is required, 'pip install redis'")
sys.exit(1)
class CacheModule(BaseCacheModule):
diff --git a/v2/ansible/plugins/connections/accelerate.py b/v2/ansible/plugins/connections/accelerate.py
index 13012aa929..78e2630eff 100644
--- a/v2/ansible/plugins/connections/accelerate.py
+++ b/v2/ansible/plugins/connections/accelerate.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import json
import os
diff --git a/v2/ansible/plugins/connections/chroot.py b/v2/ansible/plugins/connections/chroot.py
index 38c8af7a69..4e61f4ea55 100644
--- a/v2/ansible/plugins/connections/chroot.py
+++ b/v2/ansible/plugins/connections/chroot.py
@@ -15,6 +15,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import distutils.spawn
import traceback
diff --git a/v2/ansible/plugins/connections/funcd.py b/v2/ansible/plugins/connections/funcd.py
index 7244abcbe9..83a0c9b01d 100644
--- a/v2/ansible/plugins/connections/funcd.py
+++ b/v2/ansible/plugins/connections/funcd.py
@@ -18,6 +18,9 @@
# along with Ansible. If not, see .
# ---
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
# The func transport permit to use ansible over func. For people who have already setup
# func and that wish to play with ansible, this permit to move gradually to ansible
# without having to redo completely the setup of the network.
diff --git a/v2/ansible/plugins/connections/jail.py b/v2/ansible/plugins/connections/jail.py
index b721ad62b5..a81f587bfd 100644
--- a/v2/ansible/plugins/connections/jail.py
+++ b/v2/ansible/plugins/connections/jail.py
@@ -16,6 +16,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import distutils.spawn
import traceback
diff --git a/v2/ansible/plugins/connections/libvirt_lxc.py b/v2/ansible/plugins/connections/libvirt_lxc.py
index c6cf11f266..ee824554a0 100644
--- a/v2/ansible/plugins/connections/libvirt_lxc.py
+++ b/v2/ansible/plugins/connections/libvirt_lxc.py
@@ -16,6 +16,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import distutils.spawn
import os
diff --git a/v2/ansible/plugins/connections/local.py b/v2/ansible/plugins/connections/local.py
index 31d0b296e4..73583974bf 100644
--- a/v2/ansible/plugins/connections/local.py
+++ b/v2/ansible/plugins/connections/local.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import traceback
import os
diff --git a/v2/ansible/plugins/connections/paramiko_ssh.py b/v2/ansible/plugins/connections/paramiko_ssh.py
index 81470f657c..167b0d39a8 100644
--- a/v2/ansible/plugins/connections/paramiko_ssh.py
+++ b/v2/ansible/plugins/connections/paramiko_ssh.py
@@ -14,7 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
-
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
# ---
# The paramiko transport is provided because many distributions, in particular EL6 and before
diff --git a/v2/ansible/plugins/connections/ssh.py b/v2/ansible/plugins/connections/ssh.py
index e59311ead9..2c8f8de813 100644
--- a/v2/ansible/plugins/connections/ssh.py
+++ b/v2/ansible/plugins/connections/ssh.py
@@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
#
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import re
diff --git a/v2/ansible/plugins/connections/winrm.py b/v2/ansible/plugins/connections/winrm.py
index 57d26ce618..f94141b81b 100644
--- a/v2/ansible/plugins/connections/winrm.py
+++ b/v2/ansible/plugins/connections/winrm.py
@@ -14,8 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
-
-from __future__ import absolute_import
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import base64
import hashlib
diff --git a/v2/ansible/plugins/inventory/directory.py b/v2/ansible/plugins/inventory/directory.py
index d340ed7538..a75ad44ea6 100644
--- a/v2/ansible/plugins/inventory/directory.py
+++ b/v2/ansible/plugins/inventory/directory.py
@@ -18,7 +18,7 @@
#############################################
# Make coding more python3-ish
-from __future__ import (division, print_function)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
diff --git a/v2/ansible/plugins/lookup/cartesian.py b/v2/ansible/plugins/lookup/cartesian.py
index cc74240826..c50d53e7f8 100644
--- a/v2/ansible/plugins/lookup/cartesian.py
+++ b/v2/ansible/plugins/lookup/cartesian.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from itertools import product
diff --git a/v2/ansible/plugins/lookup/csvfile.py b/v2/ansible/plugins/lookup/csvfile.py
index e5fb9a4512..2a98d19fe4 100644
--- a/v2/ansible/plugins/lookup/csvfile.py
+++ b/v2/ansible/plugins/lookup/csvfile.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import codecs
diff --git a/v2/ansible/plugins/lookup/dict.py b/v2/ansible/plugins/lookup/dict.py
index 61389df7c2..cc7975ae49 100644
--- a/v2/ansible/plugins/lookup/dict.py
+++ b/v2/ansible/plugins/lookup/dict.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.plugins.lookup import LookupBase
diff --git a/v2/ansible/plugins/lookup/dnstxt.py b/v2/ansible/plugins/lookup/dnstxt.py
index 75222927c7..e9dd27bfb6 100644
--- a/v2/ansible/plugins/lookup/dnstxt.py
+++ b/v2/ansible/plugins/lookup/dnstxt.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
diff --git a/v2/ansible/plugins/lookup/env.py b/v2/ansible/plugins/lookup/env.py
index 896f95e13a..55847dd777 100644
--- a/v2/ansible/plugins/lookup/env.py
+++ b/v2/ansible/plugins/lookup/env.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
diff --git a/v2/ansible/plugins/lookup/etcd.py b/v2/ansible/plugins/lookup/etcd.py
index 5b54788985..002068389f 100644
--- a/v2/ansible/plugins/lookup/etcd.py
+++ b/v2/ansible/plugins/lookup/etcd.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import urllib2
diff --git a/v2/ansible/plugins/lookup/file.py b/v2/ansible/plugins/lookup/file.py
index add4da7f47..efb039497d 100644
--- a/v2/ansible/plugins/lookup/file.py
+++ b/v2/ansible/plugins/lookup/file.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import codecs
diff --git a/v2/ansible/plugins/lookup/fileglob.py b/v2/ansible/plugins/lookup/fileglob.py
index bde016af9e..8985906715 100644
--- a/v2/ansible/plugins/lookup/fileglob.py
+++ b/v2/ansible/plugins/lookup/fileglob.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import glob
diff --git a/v2/ansible/plugins/lookup/first_found.py b/v2/ansible/plugins/lookup/first_found.py
index b1d655b811..091f104c62 100644
--- a/v2/ansible/plugins/lookup/first_found.py
+++ b/v2/ansible/plugins/lookup/first_found.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
# take a list of files and (optionally) a list of paths
# return the first existing file found in the paths
diff --git a/v2/ansible/plugins/lookup/flattened.py b/v2/ansible/plugins/lookup/flattened.py
index 24f1a9ac95..f0a8adaf5e 100644
--- a/v2/ansible/plugins/lookup/flattened.py
+++ b/v2/ansible/plugins/lookup/flattened.py
@@ -14,7 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
-
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.errors import *
from ansible.plugins.lookup import LookupBase
diff --git a/v2/ansible/plugins/lookup/indexed_items.py b/v2/ansible/plugins/lookup/indexed_items.py
index 1731dc0e84..4f1dd19947 100644
--- a/v2/ansible/plugins/lookup/indexed_items.py
+++ b/v2/ansible/plugins/lookup/indexed_items.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.plugins.lookup import LookupBase
diff --git a/v2/ansible/plugins/lookup/inventory_hostnames.py b/v2/ansible/plugins/lookup/inventory_hostnames.py
index faffe47eb8..d09dec0c7b 100644
--- a/v2/ansible/plugins/lookup/inventory_hostnames.py
+++ b/v2/ansible/plugins/lookup/inventory_hostnames.py
@@ -16,6 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from ansible.errors import *
from ansible.plugins.lookup import LookupBase
diff --git a/v2/ansible/plugins/lookup/items.py b/v2/ansible/plugins/lookup/items.py
index 46925d2a8b..65ff66d854 100644
--- a/v2/ansible/plugins/lookup/items.py
+++ b/v2/ansible/plugins/lookup/items.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.plugins.lookup import LookupBase
diff --git a/v2/ansible/plugins/lookup/lines.py b/v2/ansible/plugins/lookup/lines.py
index 507793b18e..0d842bf148 100644
--- a/v2/ansible/plugins/lookup/lines.py
+++ b/v2/ansible/plugins/lookup/lines.py
@@ -15,8 +15,10 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
-import subprocess
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+import subprocess
from ansible.errors import *
from ansible.plugins.lookup import LookupBase
diff --git a/v2/ansible/plugins/lookup/nested.py b/v2/ansible/plugins/lookup/nested.py
index 0f2d146b47..52f4bed1d5 100644
--- a/v2/ansible/plugins/lookup/nested.py
+++ b/v2/ansible/plugins/lookup/nested.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
diff --git a/v2/ansible/plugins/lookup/password.py b/v2/ansible/plugins/lookup/password.py
index 74017eff61..2e7633a067 100644
--- a/v2/ansible/plugins/lookup/password.py
+++ b/v2/ansible/plugins/lookup/password.py
@@ -16,6 +16,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import errno
diff --git a/v2/ansible/plugins/lookup/pipe.py b/v2/ansible/plugins/lookup/pipe.py
index 0a7e5cb31a..d9f74708b2 100644
--- a/v2/ansible/plugins/lookup/pipe.py
+++ b/v2/ansible/plugins/lookup/pipe.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import subprocess
diff --git a/v2/ansible/plugins/lookup/random_choice.py b/v2/ansible/plugins/lookup/random_choice.py
index e899a2dbe3..de4f31cd0e 100644
--- a/v2/ansible/plugins/lookup/random_choice.py
+++ b/v2/ansible/plugins/lookup/random_choice.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import random
diff --git a/v2/ansible/plugins/lookup/redis_kv.py b/v2/ansible/plugins/lookup/redis_kv.py
index 08895d4c4e..e499e83f93 100644
--- a/v2/ansible/plugins/lookup/redis_kv.py
+++ b/v2/ansible/plugins/lookup/redis_kv.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import re
diff --git a/v2/ansible/plugins/lookup/sequence.py b/v2/ansible/plugins/lookup/sequence.py
index 99783cf566..1ddeba932f 100644
--- a/v2/ansible/plugins/lookup/sequence.py
+++ b/v2/ansible/plugins/lookup/sequence.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from re import compile as re_compile, IGNORECASE
diff --git a/v2/ansible/plugins/lookup/subelements.py b/v2/ansible/plugins/lookup/subelements.py
index 93e9e570c4..09a2ca306a 100644
--- a/v2/ansible/plugins/lookup/subelements.py
+++ b/v2/ansible/plugins/lookup/subelements.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.errors import *
from ansible.plugins.lookup import LookupBase
diff --git a/v2/ansible/plugins/lookup/template.py b/v2/ansible/plugins/lookup/template.py
index 74406f6445..e53e1990a0 100644
--- a/v2/ansible/plugins/lookup/template.py
+++ b/v2/ansible/plugins/lookup/template.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
diff --git a/v2/ansible/plugins/lookup/together.py b/v2/ansible/plugins/lookup/together.py
index 8b5ff5c891..2f53121cc8 100644
--- a/v2/ansible/plugins/lookup/together.py
+++ b/v2/ansible/plugins/lookup/together.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from itertools import izip_longest
diff --git a/v2/ansible/plugins/lookup/url.py b/v2/ansible/plugins/lookup/url.py
index 1b9c5c0d80..4361b1192d 100644
--- a/v2/ansible/plugins/lookup/url.py
+++ b/v2/ansible/plugins/lookup/url.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.plugins.lookup import LookupBase
import urllib2
diff --git a/v2/ansible/plugins/shell/csh.py b/v2/ansible/plugins/shell/csh.py
index 4e9f8c8af7..96ec84c5bf 100644
--- a/v2/ansible/plugins/shell/csh.py
+++ b/v2/ansible/plugins/shell/csh.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.runner.shell_plugins.sh import ShellModule as ShModule
diff --git a/v2/ansible/plugins/shell/fish.py b/v2/ansible/plugins/shell/fish.py
index 137c013c12..53fa9abada 100644
--- a/v2/ansible/plugins/shell/fish.py
+++ b/v2/ansible/plugins/shell/fish.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from ansible.runner.shell_plugins.sh import ShellModule as ShModule
diff --git a/v2/ansible/plugins/shell/powershell.py b/v2/ansible/plugins/shell/powershell.py
index 7254df6f7e..9f3825c3b0 100644
--- a/v2/ansible/plugins/shell/powershell.py
+++ b/v2/ansible/plugins/shell/powershell.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import base64
import os
diff --git a/v2/ansible/plugins/shell/sh.py b/v2/ansible/plugins/shell/sh.py
index 5fb0dc3add..497d45eace 100644
--- a/v2/ansible/plugins/shell/sh.py
+++ b/v2/ansible/plugins/shell/sh.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import re
diff --git a/v2/ansible/template/safe_eval.py b/v2/ansible/template/safe_eval.py
index c52ef398d7..81db8b2333 100644
--- a/v2/ansible/template/safe_eval.py
+++ b/v2/ansible/template/safe_eval.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import ast
import sys
diff --git a/v2/ansible/utils/color.py b/v2/ansible/utils/color.py
index a87717073e..37d0466d2d 100644
--- a/v2/ansible/utils/color.py
+++ b/v2/ansible/utils/color.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import sys
diff --git a/v2/ansible/utils/debug.py b/v2/ansible/utils/debug.py
index 3b37ac50a7..5b04ac0572 100644
--- a/v2/ansible/utils/debug.py
+++ b/v2/ansible/utils/debug.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import os
import time
import sys
diff --git a/v2/ansible/utils/display.py b/v2/ansible/utils/display.py
index 62dbeabca5..f132d4383f 100644
--- a/v2/ansible/utils/display.py
+++ b/v2/ansible/utils/display.py
@@ -16,6 +16,8 @@
# along with Ansible. If not, see .
# FIXME: copied mostly from old code, needs py3 improvements
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import textwrap
import sys
@@ -41,14 +43,14 @@ class Display:
if not log_only:
if not stderr:
try:
- print msg2
+ print(msg2)
except UnicodeEncodeError:
- print msg2.encode('utf-8')
+ print(msg2.encode('utf-8'))
else:
try:
- print >>sys.stderr, msg2
+ print(msg2, file=sys.stderr)
except UnicodeEncodeError:
- print >>sys.stderr, msg2.encode('utf-8')
+ print(msg2.encode('utf-8'), file=sys.stderr)
if C.DEFAULT_LOG_PATH != '':
while msg.startswith("\n"):
msg = msg.replace("\n","")
diff --git a/v2/ansible/utils/encrypt.py b/v2/ansible/utils/encrypt.py
index 878b461c86..5138dbef70 100644
--- a/v2/ansible/utils/encrypt.py
+++ b/v2/ansible/utils/encrypt.py
@@ -14,6 +14,9 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
PASSLIB_AVAILABLE = False
try:
diff --git a/v2/ansible/utils/path.py b/v2/ansible/utils/path.py
index ea7fc201a8..e49a2f7d55 100644
--- a/v2/ansible/utils/path.py
+++ b/v2/ansible/utils/path.py
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see .
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
import os
import stat