Skip to content

Commit

Permalink
[zerigo|dns] Fixed an issue with updating a record since the response…
Browse files Browse the repository at this point in the history
… body is an empty string, not nil.
  • Loading branch information
nirvdrum committed Jan 9, 2012
1 parent f07e594 commit 6cd10c1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/fog/zerigo/models/dns/record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@ def save
options[:notes] = description if description
options[:priority] = priority if priority
options[:ttl] = ttl if ttl
data = unless identity
connection.create_host(@zone.id, type, value, options)
else

if identity
options[:host_type] = type
options[:data] = value
connection.update_host(identity, options)
else
data = connection.create_host(@zone.id, type, value, options)
merge_attributes(data.body)
end
merge_attributes(data.body)

true
end

private

def zone=(new_zone)
@zone = new_zone
end
Expand Down

0 comments on commit 6cd10c1

Please sign in to comment.