mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix #370, by allowing to export over a existing repository
This requires to use force=True
This commit is contained in:
parent
e1194116b2
commit
d357f309b5
1 changed files with 7 additions and 4 deletions
|
@ -199,7 +199,7 @@ def main():
|
||||||
os.environ['LANG'] = 'C'
|
os.environ['LANG'] = 'C'
|
||||||
svn = Subversion(module, dest, repo, revision, username, password, svn_path)
|
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
|
before = None
|
||||||
local_mods = False
|
local_mods = False
|
||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
|
@ -227,9 +227,12 @@ def main():
|
||||||
else:
|
else:
|
||||||
module.fail_json(msg="ERROR: %s folder already exists, but its not a subversion repository." % (dest, ))
|
module.fail_json(msg="ERROR: %s folder already exists, but its not a subversion repository." % (dest, ))
|
||||||
|
|
||||||
after = svn.get_revision()
|
if export:
|
||||||
changed = before != after or local_mods
|
module.exit_json(changed=True)
|
||||||
module.exit_json(changed=changed, before=before, after=after)
|
else:
|
||||||
|
after = svn.get_revision()
|
||||||
|
changed = before != after or local_mods
|
||||||
|
module.exit_json(changed=changed, before=before, after=after)
|
||||||
|
|
||||||
# import module snippets
|
# import module snippets
|
||||||
from ansible.module_utils.basic import *
|
from ansible.module_utils.basic import *
|
||||||
|
|
Loading…
Reference in a new issue