From d357f309b5b8a42960990ccf50ee2952071f9372 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sat, 13 Dec 2014 22:07:41 +0100 Subject: [PATCH] Fix #370, by allowing to export over a existing repository This requires to use force=True --- lib/ansible/modules/source_control/subversion.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/source_control/subversion.py b/lib/ansible/modules/source_control/subversion.py index e3a013cc340..8f6d81e5694 100644 --- a/lib/ansible/modules/source_control/subversion.py +++ b/lib/ansible/modules/source_control/subversion.py @@ -199,7 +199,7 @@ def main(): os.environ['LANG'] = 'C' svn = Subversion(module, dest, repo, revision, username, password, svn_path) - if not os.path.exists(dest): + if export or not os.path.exists(dest): before = None local_mods = False if module.check_mode: @@ -227,9 +227,12 @@ def main(): else: module.fail_json(msg="ERROR: %s folder already exists, but its not a subversion repository." % (dest, )) - after = svn.get_revision() - changed = before != after or local_mods - module.exit_json(changed=changed, before=before, after=after) + if export: + module.exit_json(changed=True) + else: + after = svn.get_revision() + changed = before != after or local_mods + module.exit_json(changed=changed, before=before, after=after) # import module snippets from ansible.module_utils.basic import *