mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
Fix bug in data returns for some queries used by facts module (#52832)
* Fix bug in data returns for some queries used by facts module * Add additional query to return all servers (up to 5000) * Fix key checking in rest_api
This commit is contained in:
parent
be293fbe50
commit
e8cddfd452
3 changed files with 9 additions and 5 deletions
|
@ -150,7 +150,7 @@ def get_resource(intersight):
|
|||
def compare_values(expected, actual):
|
||||
try:
|
||||
for (key, value) in iteritems(expected):
|
||||
if re.search(r'P(ass)?w(or)?d', key) or not actual.get(key):
|
||||
if re.search(r'P(ass)?w(or)?d', key) or key not in actual:
|
||||
# do not compare any password related attributes or attributes that are not in the actual resource
|
||||
continue
|
||||
if not compare_values(value, actual[key]):
|
||||
|
@ -184,8 +184,10 @@ def configure_resource(intersight, moid):
|
|||
'resource_path': intersight.module.params['resource_path'],
|
||||
'body': intersight.module.params['api_body'],
|
||||
}
|
||||
intersight.call_api(**options)
|
||||
intersight.result['api_response'] = get_resource(intersight)
|
||||
resp = intersight.call_api(**options)
|
||||
if 'Moid' not in resp:
|
||||
resp = get_resource(intersight)
|
||||
intersight.result['api_response'] = resp
|
||||
intersight.result['changed'] = True
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue