pacman: Remove choice list for boolean values in arg spec This also makes argument_spec more consistent with core modules.

Added self as author.
pull/18777/head
Indrajit Raychaudhuri 9 years ago committed by Matt Clay
parent cd39bdd11d
commit 739ff5c807

@ -3,6 +3,7 @@
# (c) 2012, Afterburn <http://github.com/afterburn> # (c) 2012, Afterburn <http://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com> # (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com>
# (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com>
# #
# This file is part of Ansible # This file is part of Ansible
# #
@ -28,6 +29,7 @@ description:
Arch Linux and its variants. Arch Linux and its variants.
version_added: "1.0" version_added: "1.0"
author: author:
- "Indrajit Raychaudhuri (@indrajitr)"
- "'Aaron Bull Schaefer (@elasticdog)' <aaron@elasticdog.com>" - "'Aaron Bull Schaefer (@elasticdog)' <aaron@elasticdog.com>"
- "Afterburn" - "Afterburn"
notes: [] notes: []
@ -52,7 +54,7 @@ options:
that they are not required by other packages and were not that they are not required by other packages and were not
explicitly installed by a user. explicitly installed by a user.
required: false required: false
default: "no" default: no
choices: ["yes", "no"] choices: ["yes", "no"]
version_added: "1.3" version_added: "1.3"
@ -60,7 +62,7 @@ options:
description: description:
- Force remove package, without any checks. - Force remove package, without any checks.
required: false required: false
default: "no" default: no
choices: ["yes", "no"] choices: ["yes", "no"]
version_added: "2.0" version_added: "2.0"
@ -69,14 +71,14 @@ options:
- Whether or not to refresh the master package lists. This can be - Whether or not to refresh the master package lists. This can be
run as part of a package installation or as a separate step. run as part of a package installation or as a separate step.
required: false required: false
default: "no" default: no
choices: ["yes", "no"] choices: ["yes", "no"]
upgrade: upgrade:
description: description:
- Whether or not to upgrade whole system - Whether or not to upgrade whole system
required: false required: false
default: "no" default: no
choices: ["yes", "no"] choices: ["yes", "no"]
version_added: "2.0" version_added: "2.0"
''' '''
@ -251,10 +253,10 @@ def main():
argument_spec = dict( argument_spec = dict(
name = dict(aliases=['pkg']), name = dict(aliases=['pkg']),
state = dict(default='present', choices=['present', 'installed', "latest", 'absent', 'removed']), state = dict(default='present', choices=['present', 'installed', "latest", 'absent', 'removed']),
recurse = dict(default='no', choices=BOOLEANS, type='bool'), recurse = dict(default=False, type='bool'),
force = dict(default='no', choices=BOOLEANS, type='bool'), force = dict(default=False, type='bool'),
upgrade = dict(default='no', choices=BOOLEANS, type='bool'), upgrade = dict(default=False, type='bool'),
update_cache = dict(default='no', aliases=['update-cache'], choices=BOOLEANS, type='bool')), update_cache = dict(default=False, aliases=['update-cache'], type='bool')),
required_one_of = [['name', 'update_cache', 'upgrade']], required_one_of = [['name', 'update_cache', 'upgrade']],
supports_check_mode = True) supports_check_mode = True)

Loading…
Cancel
Save