mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Update various modules for check_mode
This updates the following modules to support check_mode: * apt_key * apt_repository * easy_install * pip - will always report changed due to the way it handles state * seboolean * selinux * slurp - since nothing changes, it just adds that it supports check_mode * subversion - reports changed when checking out new repo and when updating. * supervisorctl * svr4pkg See issue #2114.
This commit is contained in:
@@ -132,7 +132,8 @@ def main():
|
||||
force=dict(default='yes', type='bool'),
|
||||
username=dict(required=False),
|
||||
password=dict(required=False),
|
||||
)
|
||||
),
|
||||
supports_check_mode=True
|
||||
)
|
||||
|
||||
dest = os.path.expanduser(module.params['dest'])
|
||||
@@ -147,11 +148,15 @@ def main():
|
||||
if not os.path.exists(dest):
|
||||
before = None
|
||||
local_mods = False
|
||||
if module.check_mode:
|
||||
module.exit_json(changed=True)
|
||||
svn.checkout()
|
||||
elif os.path.exists("%s/.svn" % (dest, )):
|
||||
# Order matters. Need to get local mods before switch to avoid false
|
||||
# positives. Need to switch before revert to ensure we are reverting to
|
||||
# correct repo.
|
||||
if module.check_mode:
|
||||
module.exit_json(changed=True)
|
||||
before = svn.get_revision()
|
||||
local_mods = svn.has_local_mods()
|
||||
svn.switch()
|
||||
|
||||
Reference in New Issue
Block a user