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:
Stephen Fromm
2013-02-27 12:23:35 -08:00
parent 0342b054fd
commit 8f0d8a8546
10 changed files with 58 additions and 9 deletions

View File

@@ -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()