summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Scherer <misc@redhat.com>2016-10-16 23:39:36 +0200
committerToshio Kuratomi <a.badger@gmail.com>2016-10-17 12:22:57 -0700
commit4a0042b1f0b2ef0df715282365b48ac747f0fe38 (patch)
tree3b9d265ffadd9039557916f77da42ed6e8a65d43
parentb0159fe7d364d2268d32a8da00795b44ffac58c4 (diff)
downloadansible-modules-core-4a0042b1f0b2ef0df715282365b48ac747f0fe38.tar.gz
Make subversion module work on python 3
In python 3, filter return a iterator and so result in this traceback: Traceback (most recent call last): File \"/tmp/ansible_kzu72kz5/ansible_module_subversion.py\", line 264, in <module> main() File \"/tmp/ansible_kzu72kz5/ansible_module_subversion.py\", line 243, in main local_mods = svn.has_local_mods() File \"/tmp/ansible_kzu72kz5/ansible_module_subversion.py\", line 178, in has_local_mods return len(filter(regex.match, lines)) > 0 TypeError: object of type 'filter' has no len()
-rw-r--r--source_control/subversion.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/source_control/subversion.py b/source_control/subversion.py
index 8940154c..470779a7 100644
--- a/source_control/subversion.py
+++ b/source_control/subversion.py
@@ -175,7 +175,7 @@ class Subversion(object):
# Match only revisioned files, i.e. ignore status '?'.
regex = re.compile(r'^[^?X]')
# Has local mods if more than 0 modified revisioned files.
- return len(filter(regex.match, lines)) > 0
+ return len(list(filter(regex.match, lines))) > 0
def needs_update(self):
curr, url = self.get_revision()