diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py index 5ff86c5fdc8..14ce38b8093 100644 --- a/lib/ansible/cli/doc.py +++ b/lib/ansible/cli/doc.py @@ -218,7 +218,7 @@ class DocCLI(CLI): text.append("- name: %s" % (desc)) text.append(" action: %s" % (doc['module'])) pad = 31 - subdent = ''.join([" " for a in xrange(pad)]) + subdent = " " * pad limit = display.columns - pad for o in sorted(doc['options'].keys()): diff --git a/lib/ansible/module_utils/netcfg.py b/lib/ansible/module_utils/netcfg.py index 07b43ad2a89..63194d00dde 100644 --- a/lib/ansible/module_utils/netcfg.py +++ b/lib/ansible/module_utils/netcfg.py @@ -26,14 +26,14 @@ # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -import re -import time import itertools +import re import shlex -import itertools +import time from ansible.module_utils.basic import BOOLEANS_TRUE, BOOLEANS_FALSE from ansible.module_utils.six import string_types +from ansible.module_utils.six.moves import zip_longest DEFAULT_COMMENT_TOKENS = ['#', '!', '/*', '*/'] @@ -98,7 +98,7 @@ def ignore_line(text, tokens=None): def get_next(iterable): item, next_item = itertools.tee(iterable, 2) next_item = itertools.islice(next_item, 1, None) - return itertools.izip_longest(item, next_item) + return zip_longest(item, next_item) def parse(lines, indent, comment_tokens=None): toplevel = re.compile(r'\S') diff --git a/lib/ansible/plugins/lookup/sequence.py b/lib/ansible/plugins/lookup/sequence.py index c07337c6db0..1040bb4ebd4 100644 --- a/lib/ansible/plugins/lookup/sequence.py +++ b/lib/ansible/plugins/lookup/sequence.py @@ -19,6 +19,7 @@ __metaclass__ = type from re import compile as re_compile, IGNORECASE +from ansible.compat.six.moves import xrange from ansible.errors import AnsibleError from ansible.parsing.splitter import parse_kv from ansible.plugins.lookup import LookupBase diff --git a/test/integration/roles/setup_ec2/tasks/main.yml b/test/integration/roles/setup_ec2/tasks/main.yml index c20785b998b..7e80677def7 100644 --- a/test/integration/roles/setup_ec2/tasks/main.yml +++ b/test/integration/roles/setup_ec2/tasks/main.yml @@ -17,7 +17,7 @@ # along with Ansible. If not, see . - name: generate random string - command: python -c "import string,random; print ''.join(random.choice(string.ascii_lowercase) for _ in xrange(8));" + command: python -c "import string,random; print ''.join(random.choice(string.ascii_lowercase) for _ in range(8));" register: random_string tags: - prepare