Revision d7c67746
Added by Michael Moll almost 6 years ago
app/models/concerns/orchestration/dns.rb | ||
---|---|---|
def queue_dns_create
|
||
logger.debug "Scheduling new DNS entries"
|
||
DnsInterface::RECORD_TYPES.each do |record_type|
|
||
queue.create(:name => _("Create %{type} for %{host}") % {:host => self, :type => dns_class(record_type).human}, :priority => 10,
|
||
:action => [self, :set_dns_record, record_type]) if dns_feasible?(record_type)
|
||
if dns_feasible?(record_type)
|
||
queue.create(:name => _("Create %{type} for %{host}") % {:host => self, :type => dns_class(record_type).human}, :priority => 10,
|
||
:action => [self, :set_dns_record, record_type])
|
||
end
|
||
end
|
||
end
|
||
|
||
def queue_dns_update
|
||
return unless pending_dns_record_changes?
|
||
DnsInterface::RECORD_TYPES.each do |record_type|
|
||
queue.create(:name => _("Remove %{type} for %{host}") % {:host => old, :type => dns_class(record_type).human }, :priority => 9,
|
||
:action => [old, :del_dns_record, record_type]) if old.dns_feasible?(record_type)
|
||
if old.dns_feasible?(record_type)
|
||
queue.create(:name => _("Remove %{type} for %{host}") % {:host => old, :type => dns_class(record_type).human }, :priority => 9,
|
||
:action => [old, :del_dns_record, record_type])
|
||
end
|
||
end
|
||
queue_dns_create
|
||
end
|
||
... | ... | |
def queue_dns_destroy
|
||
return unless errors.empty?
|
||
DnsInterface::RECORD_TYPES.each do |record_type|
|
||
queue.create(:name => _("Remove %{type} for %{host}") % {:host => self, :type => dns_class(record_type).human}, :priority => 1,
|
||
:action => [self, :del_dns_record, record_type]) if dns_feasible?(record_type)
|
||
if dns_feasible?(record_type)
|
||
queue.create(:name => _("Remove %{type} for %{host}") % {:host => self, :type => dns_class(record_type).human}, :priority => 1,
|
||
:action => [self, :del_dns_record, record_type])
|
||
end
|
||
end
|
||
end
|
||
|
||
... | ... | |
return unless overwrite?
|
||
logger.debug "Scheduling DNS conflict removal"
|
||
DnsInterface::RECORD_TYPES.each do |record_type|
|
||
queue.create(:name => _("Remove conflicting %{type} for %{host}") % {:host => self, :type => dns_class(record_type).human}, :priority => 0,
|
||
:action => [self, :del_conflicting_dns_record, record_type]) if dns_feasible?(record_type) && dns_record(record_type) && dns_record(record_type).conflicting?
|
||
if dns_feasible?(record_type) && dns_record(record_type) && dns_record(record_type).conflicting?
|
||
queue.create(:name => _("Remove conflicting %{type} for %{host}") % {:host => self, :type => dns_class(record_type).human}, :priority => 0,
|
||
:action => [self, :del_conflicting_dns_record, record_type])
|
||
end
|
||
end
|
||
end
|
||
|
Also available in: Unified diff
Fixes #19873 - Fix Style/MultilineIfModifier cop (#5705)