Skip to content

Commit

Permalink
DRYied thanks to Roman's idea
Browse files Browse the repository at this point in the history
  • Loading branch information
kobliha committed Aug 13, 2013
1 parent 26d1596 commit c54d503
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/include/dns-server/dialog-masterzone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1140,15 +1140,15 @@ def StoreSoaTab
'operation' => 'add',
'type' => 'SOA',
'key' => @current_zone['zone'] + '.',
'value' => "%{server} %{mail} %{serial} %{refresh} %{retry} %{expiry} %{minimum}" % {
:server => @current_zone['soa'].fetch('server', SOADefaults::DNS_SERVER),
:mail => @current_zone['soa'].fetch('mail', SOADefaults::EMAIL_ADDRESS),
:serial => @current_zone['soa'].fetch('serial', SOADefaults::SERIAL),
:refresh => @current_zone['soa'].fetch('refresh', SOADefaults::REFRESH),
:retry => @current_zone['soa'].fetch('retry', SOADefaults::RETRY),
:expiry => @current_zone['soa'].fetch('expiry', SOADefaults::EXPIRY),
:minimum => @current_zone['soa'].fetch('minimum', SOADefaults::MINIMUM)
}
'value' => [
@current_zone['soa'].fetch('server', SOADefaults::DNS_SERVER),
@current_zone['soa'].fetch('mail', SOADefaults::EMAIL_ADDRESS),
@current_zone['soa'].fetch('serial', SOADefaults::SERIAL),
@current_zone['soa'].fetch('refresh', SOADefaults::REFRESH),
@current_zone['soa'].fetch('retry', SOADefaults::RETRY),
@current_zone['soa'].fetch('expiry', SOADefaults::EXPIRY),
@current_zone['soa'].fetch('minimum', SOADefaults::MINIMUM)
].join ' '
}
end

Expand Down Expand Up @@ -1927,8 +1927,13 @@ def CheckNewZoneRecordSyntax(record)
# %{current} - replaced with the current length of a new TXT record.
Popup.Error(
_(
"Maximal length of a %{type} record is %{max} characters.\nThis message is %{current} characters long."
) % {:type => type, :max => MAX_TEXT_RECORD_LENGTH, :current => val.size}
"Maximal length of a %{type} record is %{max} characters.\n"
"This message is %{current} characters long."
) % {
:type => type,
:max => MAX_TEXT_RECORD_LENGTH,
:current => val.size
}
)
return false
end
Expand Down

0 comments on commit c54d503

Please sign in to comment.