mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-22 13:19:13 +00:00
uv_python module: remove catch all exception
This commit is contained in:
parent
54e7a639ef
commit
4659d3f544
1 changed files with 8 additions and 11 deletions
|
|
@ -199,18 +199,15 @@ def main():
|
|||
)
|
||||
state = module.params["state"]
|
||||
|
||||
try:
|
||||
uv = UV(module)
|
||||
if state == "present":
|
||||
result["changed"], result["msg"] = uv.install_python()
|
||||
elif state == "absent":
|
||||
result["changed"], result["msg"] = uv.uninstall_python()
|
||||
elif state == "latest":
|
||||
result["changed"], result["msg"] = uv.upgrade_python()
|
||||
uv = UV(module)
|
||||
if state == "present":
|
||||
result["changed"], result["msg"] = uv.install_python()
|
||||
elif state == "absent":
|
||||
result["changed"], result["msg"] = uv.uninstall_python()
|
||||
elif state == "latest":
|
||||
result["changed"], result["msg"] = uv.upgrade_python()
|
||||
|
||||
module.exit_json(**result)
|
||||
except Exception as e:
|
||||
module.fail_json(msg=str(e))
|
||||
module.exit_json(**result)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue