Fix idempotency issues in set_bios_attributes

- Added check to see if attribute even exists, if not, it exits.
- Then checks if attribute is already set to value we want to update
  it to. If yes, then it exits and changed=False
- Otherwise updates the attribute and changed=True
This commit is contained in:
Jose Delarosa 2018-10-22 15:33:27 -05:00 committed by Brian Coca
commit 1c37471274
3 changed files with 11 additions and 4 deletions

View file

@ -227,8 +227,7 @@ def main():
# Return data back or fail with proper message
if result['ret'] is True:
del result['ret']
module.exit_json(changed=True, msg='Action was successful')
module.exit_json(changed=result['changed'], msg=to_native(result['msg']))
else:
module.fail_json(msg=to_native(result['msg']))