ansible-collections / google.cloud

GCP Ansible Collection https://galaxy.ansible.com/google/cloud
https://cloud.google.com
GNU General Public License v3.0
99 stars 126 forks source link

Fix error handling in creation of service account keys #612

Open bgandon opened 8 months ago

bgandon commented 8 months ago
SUMMARY

When creating a service account key with the google.cloud.gcp_iam_service_account_key module, when the service_account.name was incorrect, the 404 error was improperly interpreted as normal business, and resulted in a cryptic stacktrace. Plus, the gcp_iam_service_account_key module had no integration test at all.

Here we fix the above issue and we add proper integration test cases.

Fixes: #244

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

This affects the google.cloud.gcp_iam_service_account_key module only.

ADDITIONAL INFORMATION

Passing tests: ansible-test integration "gcp_iam_service_account_key".