diff --git a/provider/ansible/request.rb b/provider/ansible/request.rb index 20d2ad36042d..6e3888c025b2 100644 --- a/provider/ansible/request.rb +++ b/provider/ansible/request.rb @@ -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) && \