From f7592bbe5f2bf2d657abae5545aeefcd37a4aeb1 Mon Sep 17 00:00:00 2001 From: Alex Stephen Date: Wed, 26 Sep 2018 17:31:14 +0000 Subject: [PATCH] Removing the <|extra|> marker because it's only used in DNS custom code --- .../provider/gdns_resource_record_set/google.rb | 15 ++++++--------- spec/gdns_resource_record_set_provider_spec.rb | 9 +++------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/lib/puppet/provider/gdns_resource_record_set/google.rb b/lib/puppet/provider/gdns_resource_record_set/google.rb index acb680a..42e2bec 100644 --- a/lib/puppet/provider/gdns_resource_record_set/google.rb +++ b/lib/puppet/provider/gdns_resource_record_set/google.rb @@ -150,21 +150,18 @@ def debug(message) super(message) end - def self.collection(data, extra = '', extra_data = {}) + def self.collection(data) URI.join( 'https://www.googleapis.com/dns/v1/', expand_variables( - [ - 'projects/{{project}}/managedZones/{{managed_zone}}/changes', - extra - ].join, - data, extra_data + 'projects/{{project}}/managedZones/{{managed_zone}}/changes', + data ) ) end - def collection(data, extra = '', extra_data = {}) - self.class.collection(data, extra, extra_data) + def collection(data) + self.class.collection(data) end def self.self_link(data) @@ -321,7 +318,7 @@ def wait_for_change_to_complete(change_id, resource) def get_change_status(change_id, resource) change_req = ::Google::Dns::Network::Get.new( - collection(resource, '/{{id}}', id: change_id), fetch_auth(resource) + "#{collection(resource)}/#{change_id}", fetch_auth(resource) ) return_if_change_object(change_req.send)['status'] end diff --git a/spec/gdns_resource_record_set_provider_spec.rb b/spec/gdns_resource_record_set_provider_spec.rb index 807ce95..36e8b87 100644 --- a/spec/gdns_resource_record_set_provider_spec.rb +++ b/spec/gdns_resource_record_set_provider_spec.rb @@ -807,15 +807,12 @@ def expect_network_create_change(change_id, id, done, expected_body, .and_return(request) end - def collection(data, extra = '', extra_data = {}) + def collection(data) URI.join( 'https://www.googleapis.com/dns/v1/', expand_variables( - [ - 'projects/{{project}}/managedZones/{{managed_zone}}/changes', - extra - ].join, - data, extra_data + 'projects/{{project}}/managedZones/{{managed_zone}}/changes', + data ) ) end