Adding exception type on Ansible Service Account Keys (#174)

<!-- This change is generated by MagicModules. -->
/cc @rambleraptor
This commit is contained in:
The Magician 2019-01-23 12:27:53 -08:00 committed by Alex Stephen
parent 2b3eff6d82
commit 6cbacba697

View file

@ -238,7 +238,7 @@ def key_name_from_file(filename, module):
try:
json_data = json.loads(f.read())
return "projects/{project_id}/serviceAccounts/{client_email}/keys/{private_key_id}".format(**json_data)
except:
except ValueError as inst:
module.fail_json(msg="File is not a valid GCP JSON service account key")