diff options
author | Michael Scherer <misc@redhat.com> | 2016-10-16 23:39:36 +0200 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-10-17 12:50:54 -0700 |
commit | a7a4c66b1e09008238edffe87461ea6fabd3ae2a (patch) | |
tree | e94d59a73ba0221b553e5633da66ce22841823ca | |
parent | a6e86a3b59b4a321f1c826c40b02941aca1fc9f3 (diff) | |
download | ansible-modules-core-a7a4c66b1e09008238edffe87461ea6fabd3ae2a.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()
(cherry picked from commit 4a0042b1f0b2ef0df715282365b48ac747f0fe38)
-rw-r--r-- | source_control/subversion.py | 2 |
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() |