Skip to content

Commit

Permalink
Ansible bugfix.
Browse files Browse the repository at this point in the history
The function called for virtual resourceref selflinks was different here
and at the declaration point.  Here it was
'underscored(prop.name)_selflink', but in the other place it's
underscored(referenced_resource.name)_selflink'.  This works sometimes,
but in case of 'DiskType' vs Disk's field 'Type', it doesn't.
  • Loading branch information
nat-henderson committed Jul 9, 2018
1 parent 9f1fd90 commit 035ab4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions provider/ansible/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ def request_output(prop, hash_name, module_name)
].join
elsif prop.is_a?(Api::Type::ResourceRef) && \
prop.resource_ref.virtual && prop.imports == 'selfLink'
func_name = Google::StringUtils.underscore("#{prop.name}_selflink")
func = "#{Google::StringUtils.underscore(prop.resource)}_selflink"
[
"#{func_name}(#{hash_name}.get(#{quote_string(prop.out_name)}),",
"#{func}(#{hash_name}.get(#{quote_string(prop.out_name)}),",
"#{module_name}.params)"
].join(' ')
elsif prop.is_a?(Api::Type::Array) && \
Expand Down

0 comments on commit 035ab4c

Please sign in to comment.