diff --git a/v2/ansible/executor/playbook_executor.py b/v2/ansible/executor/playbook_executor.py
index 8af19ed378f..6f0bf31f337 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 c8e3cddebaa..063398f17f9 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 52f7af8b53f..73c882f288f 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 f1297409355..b5a957c53fe 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 87d6f64dfc6..6525e69b466 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 4236140ac88..e004ee8bb75 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 13b53a24f5e..9675d70f690 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 5d4b4b6658c..8f0c98cad56 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 37c97d0195f..59dbf9f8c4c 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 7242322b88f..92f1c64c83e 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 33fd5efd9fa..c7f89888b87 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 638d4b92bb5..4e796bddb6f 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 7204d93875e..5c4fdd7b89c 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 6fbf93d61fe..7c02e09757e 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 dcee3e6347d..dc80dfc1795 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 a95ccb32f74..b7845c95c5c 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 7b549f5ecbc..58e7cebb8d2 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 50e0cc09c43..95db33aa43f 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 345e0edc0e9..8a7a74d8705 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 66721b4eb25..431d9b0eebe 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 c56e6654b1b..c5a97d53666 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 d1d1b280561..f9cd56572b1 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 21a9f41c59b..3ca7dc6a342 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 bf89e7ec517..a7ddf10b474 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 81e335b0098..1bc64ff4d5b 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 f82cbb37667..a234ef2eee9 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 1b6cb354f0f..b7601ed9107 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 deed7f3ecde..4aa8fda8bbb 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 b6254cdfd48..6ff3d5ed1e2 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 deaf07fe2e2..e7321a5a6b5 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 007719a6477..15628361513 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 7f126de64bb..287c14bd2a2 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 13012aa9299..78e2630eff0 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 38c8af7a690..4e61f4ea559 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 7244abcbe9a..83a0c9b01d3 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 b721ad62b50..a81f587bfd0 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 c6cf11f2667..ee824554a02 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 31d0b296e4a..73583974bf0 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 81470f657c8..167b0d39a88 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 e59311ead96..2c8f8de8135 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 57d26ce6188..f94141b81b6 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 d340ed75387..a75ad44ea6c 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 cc74240826a..c50d53e7f80 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 e5fb9a45121..2a98d19fe4c 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 61389df7c2e..cc7975ae499 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 75222927c79..e9dd27bfb6c 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 896f95e13a9..55847dd7779 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 5b54788985b..002068389f8 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 add4da7f47b..efb039497dd 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 bde016af9e4..89859067150 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 b1d655b8114..091f104c628 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 24f1a9ac950..f0a8adaf5e6 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 1731dc0e847..4f1dd199471 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 faffe47eb85..d09dec0c7b5 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 46925d2a8ba..65ff66d854a 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 507793b18e9..0d842bf148f 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 0f2d146b478..52f4bed1d52 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 74017eff619..2e7633a067a 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 0a7e5cb31ae..d9f74708b28 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 e899a2dbe3c..de4f31cd0eb 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 08895d4c4ec..e499e83f938 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 99783cf566b..1ddeba932f8 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 93e9e570c41..09a2ca306a1 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 74406f64458..e53e1990a0d 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 8b5ff5c8919..2f53121cc8b 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 1b9c5c0d808..4361b1192d2 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 4e9f8c8af74..96ec84c5bf8 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 137c013c12f..53fa9abada6 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 7254df6f7ea..9f3825c3b0f 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 5fb0dc3add3..497d45eace2 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 c52ef398d76..81db8b2333c 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 a87717073eb..37d0466d2d1 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 3b37ac50a78..5b04ac05726 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 62dbeabca51..f132d4383f9 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 878b461c86d..5138dbef705 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 ea7fc201a89..e49a2f7d553 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