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
Update our provider to match dnsimple-ruby 4.5.0 #60
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good one! Glad the tests help here. I have style suggestions though.
I'm going to mark approved as these are suggestions not requirement for merge
@@ -31,7 +31,7 @@ def load_current_resource | |||
@current_resource.domain(@new_resource.domain) | |||
@current_resource.type(@new_resource.type) | |||
|
|||
records = dnsimple_client.zones.all_records(dnsimple_client_account_id, | |||
records = dnsimple_client.zones.list_zone_records(dnsimple_client_account_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look at this. I tried the patch and it does fix that error, but list_zone_records
is paginated with 30 records per page so the logic below to detect if this in existing record often fails once someone has more than 30 records.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be all_zone_records
instead
@@ -31,7 +31,7 @@ def load_current_resource | |||
@current_resource.domain(@new_resource.domain) | |||
@current_resource.type(@new_resource.type) | |||
|
|||
records = dnsimple_client.zones.all_records(dnsimple_client_account_id, | |||
records = dnsimple_client.zones.list_zone_records(dnsimple_client_account_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
records = dnsimple_client.zones.list_zone_records(dnsimple_client_account_id, | |
records = dnsimple_client.zones.all_zone_records(dnsimple_client_account_id, |
The method was renamed from all_records
to all_zone_records
.
@@ -29,7 +29,7 @@ | |||
let(:response) { instance_double(Dnsimple::Response, data: data) } | |||
let(:data) { instance_double(Dnsimple::Struct::Whoami, account: account) } | |||
let(:account) { instance_double(Dnsimple::Struct::Account, id: 1) } | |||
let(:zones) { instance_double(Dnsimple::Client::ZonesService, all_records: zone_records, create_record: zone_record) } | |||
let(:zones) { instance_double(Dnsimple::Client::ZonesService, list_zone_records: zone_records, create_zone_record: zone_record) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let(:zones) { instance_double(Dnsimple::Client::ZonesService, list_zone_records: zone_records, create_zone_record: zone_record) } | |
let(:zones) { instance_double(Dnsimple::Client::ZonesService, all_zone_records: zone_records, create_zone_record: zone_record) } |
@@ -40,7 +40,7 @@ def response | |||
|
|||
filter = {} | |||
filter = { type: @type } if @type | |||
client.zones.records(account_id, @zone, filter: filter).data.detect do |record| | |||
client.zones.list_zone_records(account_id, @zone, filter: filter).data.detect do |record| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client.zones.list_zone_records(account_id, @zone, filter: filter).data.detect do |record| | |
client.zones.all_zone_records(account_id, @zone, filter: filter).data.detect do |record| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martinisoft there is this one missing
@@ -40,7 +40,7 @@ def response | |||
|
|||
filter = {} | |||
filter = { type: @type } if @type | |||
client.zones.records(account_id, @zone, filter: filter).data.detect do |record| | |||
client.zones.list_zone_records(account_id, @zone, filter: filter).data.detect do |record| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client.zones.list_zone_records(account_id, @zone, filter: filter).data.detect do |record| | |
client.zones.all_zone_records(account_id, @zone, filter: filter).data.detect do |record| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this one
@@ -171,7 +171,7 @@ | |||
let(:response) { instance_double(Dnsimple::Response, data: data) } | |||
let(:data) { instance_double(Dnsimple::Struct::Whoami, account: account) } | |||
let(:account) { instance_double(Dnsimple::Struct::Account, id: 1) } | |||
let(:zones) { instance_double(Dnsimple::Client::ZonesService, all_records: zone_records, update_record: zone_record) } | |||
let(:zones) { instance_double(Dnsimple::Client::ZonesService, list_zone_records: zone_records, update_zone_record: zone_record) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let(:zones) { instance_double(Dnsimple::Client::ZonesService, list_zone_records: zone_records, update_zone_record: zone_record) } | |
let(:zones) { instance_double(Dnsimple::Client::ZonesService, all_zone_records: zone_records, update_zone_record: zone_record) } |
end | ||
|
||
let(:client) { instance_double(Dnsimple::Client, identity: identity, zones: zones) } | ||
let(:identity) { instance_double(Dnsimple::Client::Identity, whoami: response) } | ||
let(:response) { instance_double(Dnsimple::Response, data: data) } | ||
let(:data) { instance_double(Dnsimple::Struct::Whoami, account: account) } | ||
let(:account) { instance_double(Dnsimple::Struct::Account, id: 1) } | ||
let(:zones) { instance_double(Dnsimple::Client::ZonesService, all_records: zone_records) } | ||
let(:zones) { instance_double(Dnsimple::Client::ZonesService, list_zone_records: zone_records) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let(:zones) { instance_double(Dnsimple::Client::ZonesService, list_zone_records: zone_records) } | |
let(:zones) { instance_double(Dnsimple::Client::ZonesService, all_zone_records: zone_records) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martinisoft the direct replacement of all_records
is all_zone_records
. I provided inline suggestions for easy approval.
@weppos I have replaced all the methods, thank you for the assist on this one. Waiting for a green CI build. |
@thekendalmiller Let us know how my latest updates work for you now. Did not know about the difference in methods so that should be corrected now. If all is well, I will cut a new patch release since this is also affecting us in production (yes, we dogfood our own cookbook) |
@martinisoft Thanks. It works for me now |
This changeset resolves the breakage that occured in the 4.5.0 release which should resolve dnsimple/dnsimple-ruby#169