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

@@ -128,8 +128,9 @@ def main():
state = dict(required = True, choices=['present', 'absent']),
src = dict(default = None),
proxy = dict(default = None)
)
)
),
supports_check_mode=True
)
state = module.params['state']
name = module.params['name']
src = module.params['src']
@@ -146,6 +147,8 @@ def main():
module.fail_json(name=name,
msg="src is required when state=present")
if not package_installed(module, name):
if module.check_mode:
module.exit_json(changed=True)
(rc, out, err) = package_install(module, name, src, proxy)
# Stdout is normally empty but for some packages can be
# very long and is not often useful
@@ -154,6 +157,8 @@ def main():
elif state == 'absent':
if package_installed(module, name):
if module.check_mode:
module.exit_json(changed=True)
(rc, out, err) = package_uninstall(module, name, src)
out = out[:75]