Fixes for apt module

reviewable/pr18780/r1
Mark Theunissen 12 years ago
parent 07880e6301
commit 12b7b2750c

6
apt

@ -138,13 +138,13 @@ def main():
# reopen cache w/ modified config # reopen cache w/ modified config
cache.open(progress=None) cache.open(progress=None)
if modules.boolean(p['update_cache']) if module.boolean(p['update_cache']):
cache.update() cache.update()
cache.open(progress=None) cache.open(progress=None)
if p['package'] == None: if p['package'] == None:
module.exit_json(changed=False) module.exit_json(changed=False)
force_yes = modules.boolean(p['force']) force_yes = module.boolean(p['force'])
if p['package'].count('=') > 1: if p['package'].count('=') > 1:
module.fail_json(msg='invalid package spec') module.fail_json(msg='invalid package spec')
@ -161,7 +161,7 @@ def main():
install(module, p['package'], cache, default_release=p['default_release'], install(module, p['package'], cache, default_release=p['default_release'],
install_recommends=install_recommends,force=force_yes) install_recommends=install_recommends,force=force_yes)
elif p['state'] == 'removed': elif p['state'] == 'removed':
remove(module, p['package'], cache, purge = modules.boolean(p['purge'])) remove(module, p['package'], cache, purge = module.boolean(p['purge']))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>> #<<INCLUDE_ANSIBLE_MODULE_COMMON>>

Loading…
Cancel
Save