mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
Expose timeout option to Redfish modules (#54130)
* added timeout option to Redfish modules * Apply suggestions from code review Removed 'required: false' and added 'type: int' to 'timeout' documentation string. Co-Authored-By: billdodd <billdodd@gmail.com>
This commit is contained in:
parent
a47edc9968
commit
d8536e47d3
5 changed files with 57 additions and 13 deletions
|
@ -41,6 +41,12 @@ options:
|
|||
required: true
|
||||
description:
|
||||
- Password for authentication with OOB controller
|
||||
timeout:
|
||||
description:
|
||||
- Timeout in seconds for URL requests to OOB controller
|
||||
default: 10
|
||||
type: int
|
||||
version_added: '2.8'
|
||||
|
||||
author: "Jose Delarosa (@jose-delarosa)"
|
||||
'''
|
||||
|
@ -126,7 +132,8 @@ def main():
|
|||
command=dict(required=True, type='list'),
|
||||
baseuri=dict(required=True),
|
||||
username=dict(required=True),
|
||||
password=dict(required=True, no_log=True)
|
||||
password=dict(required=True, no_log=True),
|
||||
timeout=dict(type='int', default=10)
|
||||
),
|
||||
supports_check_mode=False
|
||||
)
|
||||
|
@ -138,10 +145,13 @@ def main():
|
|||
creds = {'user': module.params['username'],
|
||||
'pswd': module.params['password']}
|
||||
|
||||
# timeout
|
||||
timeout = module.params['timeout']
|
||||
|
||||
# Build root URI
|
||||
root_uri = "https://" + module.params['baseuri']
|
||||
rf_uri = "/redfish/v1/"
|
||||
rf_utils = IdracRedfishUtils(creds, root_uri)
|
||||
rf_utils = IdracRedfishUtils(creds, root_uri, timeout)
|
||||
|
||||
# Check that Category is valid
|
||||
if category not in CATEGORY_COMMANDS_ALL:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue