Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This resource is a singleton and is only driven off one unique key, "… #220

Merged
merged 2 commits into from
Dec 13, 2019

Conversation

lhasadreams
Copy link
Contributor

…name".

Removed "display_name" as a call option as that caused a crash due to a bug in the code.
"display_name" is not gauranteed to be unique.
Signed-off-by: Adrian Daniels [email protected]

Description

Stops the crashing when called using display_name.
Alters the code and docs to only use name.

…name".

Removed "display_name" as a call option as that caused a crash due to a bug in the code.
"display_name" is not gauranteed to be unique.
Signed-off-by: Adrian Daniels <[email protected]>
@lhasadreams lhasadreams requested a review from a team as a code owner December 12, 2019 11:16
catch_gcp_errors do
@organization = @gcp.gcp_project_client.get_organization(opts[:name])
create_resource_methods(@organization)
if opts[:name]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @lhasadreams - this if statement is slightly problematic because the resource will silently do nothing if the name is not provided.

Could you replace this with something like the following:

raise Inspec::Exceptions::ResourceFailed, "google_organization is missing mandatory property 'name'" if opts[:name].nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that makes a lot of sense - code updated

@skpaterson skpaterson merged commit 7066496 into inspec:master Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants