reinstate invalid argument checks where possible, daisy chainee/chained modules turn it off
This commit is contained in:
parent
2c314553cc
commit
fb8200b9b9
3 changed files with 6 additions and 8 deletions
2
copy
2
copy
|
@ -23,6 +23,8 @@ import shutil
|
|||
def main():
|
||||
|
||||
module = AnsibleModule(
|
||||
# not checking because of daisy chain to file module
|
||||
check_invalid_arguments = False,
|
||||
argument_spec = dict(
|
||||
src=dict(required=True),
|
||||
dest=dict(required=True)
|
||||
|
|
10
file
10
file
|
@ -212,7 +212,8 @@ def rmtree_error(func, path, exc_info):
|
|||
def main():
|
||||
|
||||
global module
|
||||
module = AnsibleFileModule(
|
||||
module = AnsibleModule(
|
||||
check_invalid_arguments = False,
|
||||
argument_spec = dict(
|
||||
state = dict(choices=['file','directory','link','absent'], default='file'),
|
||||
path = dict(aliases=['dest', 'name'], required=True),
|
||||
|
@ -348,12 +349,5 @@ def main():
|
|||
|
||||
# this is magic, see lib/ansible/module_common.py
|
||||
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
|
||||
|
||||
class AnsibleFileModule(AnsibleModule):
|
||||
|
||||
def _check_invalid_arguments(self):
|
||||
# needed to support daisy chaining
|
||||
pass
|
||||
|
||||
main()
|
||||
|
||||
|
|
2
get_url
2
get_url
|
@ -128,6 +128,8 @@ def main():
|
|||
module.fail_json(msg="urlparse is not installed")
|
||||
|
||||
module = AnsibleModule(
|
||||
# not checking because of daisy chain to file module
|
||||
check_invalid_arguments = False,
|
||||
argument_spec = dict(
|
||||
url = dict(required=True),
|
||||
dest = dict(required=True),
|
||||
|
|
Loading…
Add table
Reference in a new issue