Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ansible-collections#681 from tremble/aws_secret/de…
…letion_idempotency aws_secret - fix deletion idempotency when not using instant deletion SUMMARY If you try to delete a secret that's already pending deletion the aws_secret threw an exception because result hadn't been defined. Also enables basic tests for aws_secret. note: "something" is broken with the rotation tests, so these are skipped for now. Better that we have partial test coverage than none. ISSUE TYPE Bugfix Pull Request COMPONENT NAME aws_secret ADDITIONAL INFORMATION An exception occurred during task execution. To see the full traceback, use -vvv. The error was: UnboundLocalError: local variable 'result' referenced before assignment fatal: [testhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1628676235.3853-364-73867477372190/AnsiballZ_aws_secret.py\", line 114, in <module>\n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-tmp-1628676235.3853-364-73867477372190/AnsiballZ_aws_secret.py\", line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-tmp-1628676235.3853-364-73867477372190/AnsiballZ_aws_secret.py\", line 54, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.aws_secret', init_globals=dict(_module_fqn='ansible_collections.community.aws.plugins.modules.aws_secret', _modlib_path=modlib_path),\n File \"/usr/lib/python3.9/runpy.py\", line 210, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.9/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.9/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_aws_secret_payload_6xlyxr1u/ansible_aws_secret_payload.zip/ansible_collections/community/aws/plugins/modules/aws_secret.py\", line 401, in <module>\n File \"/tmp/ansible_aws_secret_payload_6xlyxr1u/ansible_aws_secret_payload.zip/ansible_collections/community/aws/plugins/modules/aws_secret.py\", line 397, in main\nUnboundLocalError: local variable 'result' referenced before assignment\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error Depends-On: ansible-collections#686 Reviewed-by: Alina Buzachis <None> Reviewed-by: None <None>
- Loading branch information