Permalink
Browse files

Fixing parsing of zone.records.get(id) so that it parses a single rec…

…ord properly rather than attempting to parse a list of records improperly. Fixing tests to match this (expected) behavior rather than work-around the broken way.
  • Loading branch information...
1 parent c8c4324 commit 21e80718a5a56a02934e31a2e1f5fd9b152a8908 @patio11 committed Nov 8, 2011
Showing with 3 additions and 4 deletions.
  1. +1 −1 lib/fog/slicehost/requests/dns/get_record.rb
  2. +2 −3 tests/slicehost/requests/dns/dns_tests.rb
@@ -21,7 +21,7 @@ def get_record(record_id)
request(
:expects => 200,
:method => 'GET',
- :parser => Fog::Parsers::DNS::Slicehost::GetRecords.new,
+ :parser => Fog::Parsers::DNS::Slicehost::GetRecord.new,
:path => "records/#{record_id}.xml"
)
end
@@ -183,7 +183,7 @@
response = Fog::DNS[:slicehost].get_record(@record_id)
if response.status == 200
mail_domain = 'mail.' + @domain
- record = response.body['records'][0]
+ record = response.body
if (record['record_type'] == 'MX') and (record['name'] == @domain) and
(record['value'] == mail_domain) and (record['ttl'] == 3600) and (record['active'] == 'N') and
(record['aux'] == "10")
@@ -247,8 +247,7 @@
mail_domain = 'mail.' + @domain
- records = Fog::DNS[:slicehost].get_record(specific_record['id']).body["records"]
- record = records[0]
+ record = Fog::DNS[:slicehost].get_record(specific_record['id']).body
if (record['record_type'] == 'MX') and (record['name'] == @domain) and
(record['value'] == mail_domain) and (record['ttl'] == 7200) and (record['active'] == 'N') and

0 comments on commit 21e8071

Please sign in to comment.