Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print function #10690

Merged
merged 2 commits into from
Apr 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion v2/ansible/executor/playbook_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

# Make coding more python3-ish
from __future__ import (absolute_import, division)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import signal
Expand Down
3 changes: 3 additions & 0 deletions v2/ansible/inventory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

#############################################
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import fnmatch
import os
import sys
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/inventory/dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

#############################################
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import os

Expand Down
3 changes: 3 additions & 0 deletions v2/ansible/inventory/expand_hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
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
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/inventory/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.utils.debug import debug

Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/inventory/ini.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

#############################################
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import ast
import shlex
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/inventory/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

#############################################
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import os
import subprocess
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/inventory/vars_plugins/noop.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

class VarsModule(object):

Expand Down
21 changes: 20 additions & 1 deletion v2/ansible/parsing/utils/jsonify.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
# FIXME: header
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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 <http://www.gnu.org/licenses/>.

# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

try:
import json
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/playbook/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import os

Expand Down
2 changes: 1 addition & 1 deletion v2/ansible/playbook/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

# 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
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/assemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/assert.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.errors import AnsibleError
from ansible.playbook.conditional import Conditional
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/async.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import json
import random
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.plugins.action import ActionBase
from ansible.utils.boolean import boolean
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/fail.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.plugins.action import ActionBase

Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import os
import pwd
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.errors import *
from ansible.plugins.action import ActionBase
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/include_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import os

Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.plugins.action import ActionBase

Expand Down
6 changes: 4 additions & 2 deletions v2/ansible/plugins/action/pause.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import datetime
import sys
Expand Down Expand Up @@ -99,7 +101,7 @@ def run(self, tmp=None, task_vars=dict()):

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)
Expand All @@ -110,7 +112,7 @@ def run(self, tmp=None, task_vars=dict()):
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
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.plugins.action import ActionBase

Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import os

Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/set_fact.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.errors import AnsibleError
from ansible.plugins.action import ActionBase
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/synchronize.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import os.path

Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import base64
import os
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/action/unarchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import os
import pipes
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/cache/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from collections import MutableMapping

Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/cache/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import exceptions

Expand Down
4 changes: 3 additions & 1 deletion v2/ansible/plugins/cache/memcached.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import collections
import os
Expand All @@ -28,7 +30,7 @@
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)


Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/cache/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.plugins.cache.base import BaseCacheModule

Expand Down
6 changes: 3 additions & 3 deletions v2/ansible/plugins/cache/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
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
Expand All @@ -28,7 +28,7 @@
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):
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/connections/accelerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import json
import os
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/connections/chroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import distutils.spawn
import traceback
Expand Down
3 changes: 3 additions & 0 deletions v2/ansible/plugins/connections/funcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

# ---
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.
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/connections/jail.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import distutils.spawn
import traceback
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/connections/libvirt_lxc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import distutils.spawn
import os
Expand Down
2 changes: 2 additions & 0 deletions v2/ansible/plugins/connections/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import traceback
import os
Expand Down