Skip to content

Commit

Permalink
fix updating existing zerigo record
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Conway committed May 10, 2010
1 parent 400e814 commit cb5bfdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rubber/dns/zerigo.rb
Expand Up @@ -92,14 +92,14 @@ def destroy_host_record(opts = {})

def update_host_record(old_opts={}, new_opts={})
old_opts = setup_opts(old_opts, [:host, :domain])
new_opts = setup_opts(new_opts.merge(:no_defaults =>true), [])
new_opts = setup_opts(new_opts, [:host, :domain, :type, :data])
zone = ::Zerigo::DNS::Zone.find_or_create(old_opts[:domain])

find_hosts(old_opts).each do |h|
opts_to_host(new_opts).each do |k, v|
h.send("#{k}=", v)
end
h.save || raise("Failed to update host #{h.hostname}")
h.save || raise("Failed to update host #{h.hostname}, #{h.errors.full_messages.join(', ')}")
end
end

Expand Down

0 comments on commit cb5bfdd

Please sign in to comment.