From f4158304acb055ac79a96293545394d8a7fae020 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 31 Aug 2016 17:16:35 +0200 Subject: [PATCH] Port mount.py to python3, need to use six.iteritems (#4581) --- lib/ansible/modules/system/mount.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/system/mount.py b/lib/ansible/modules/system/mount.py index 0be9ee2416..bd62a148bb 100644 --- a/lib/ansible/modules/system/mount.py +++ b/lib/ansible/modules/system/mount.py @@ -88,6 +88,7 @@ EXAMPLES = ''' - mount: name=/home src='UUID=b3e48f45-f933-4c8e-a700-22a159ec9077' fstype=xfs opts=noatime state=present ''' +from ansible.module_utils.six import iteritems def write_fstab(lines, dest): @@ -122,7 +123,7 @@ def set_mount(module, **kwargs): to_write = [] exists = False changed = False - escaped_args = dict([(k, _escape_fstab(v)) for k, v in args.iteritems()]) + escaped_args = dict([(k, _escape_fstab(v)) for k, v in iteritems(args)]) for line in open(args['fstab'], 'r').readlines(): if not line.strip(): to_write.append(line)