mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-11 16:44:22 -07:00
moved module checking below module initialization
This commit is contained in:
parent
27145fab7f
commit
2ecf3f9b94
1 changed files with 5 additions and 4 deletions
|
@ -256,10 +256,6 @@ def uri(module, url, dest, user, password, body, method, headers, redirects):
|
||||||
module.fail_json(msg="Socket error: %s to %s" % (e, url))
|
module.fail_json(msg="Socket error: %s to %s" % (e, url))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if not HAS_HTTPLIB2:
|
|
||||||
module.fail_json(msg="httplib2 is not installed")
|
|
||||||
if not HAS_URLPARSE:
|
|
||||||
module.fail_json(msg="urlparse is not installed")
|
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
|
@ -280,6 +276,11 @@ def main():
|
||||||
add_file_common_args=True
|
add_file_common_args=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not HAS_HTTPLIB2:
|
||||||
|
module.fail_json(msg="httplib2 is not installed")
|
||||||
|
if not HAS_URLPARSE:
|
||||||
|
module.fail_json(msg="urlparse is not installed")
|
||||||
|
|
||||||
url = module.params['url']
|
url = module.params['url']
|
||||||
user = module.params['user']
|
user = module.params['user']
|
||||||
password = module.params['password']
|
password = module.params['password']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue