1
0
Fork 0
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:
Mariam Ahhttouche 2026-02-17 15:29:03 +01:00
parent 54e7a639ef
commit 4659d3f544

View file

@ -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()