Fixed TLSA support and added support for SSHFP record type

This commit is contained in:
Thomas Sturm
2016-01-11 21:42:42 +01:00
parent 27f253354b
commit fbb7e3c7d7
2 changed files with 12 additions and 3 deletions
+11 -2
View File
@@ -81,7 +81,7 @@ module PuppetBind
end
def spaced_type?(type)
%w(DS TLSA).include?(type)
%w(DS TLSA SSHFP).include?(type)
end
def maybe_quote(type, datum)
@@ -97,7 +97,16 @@ module PuppetBind
end
def maybe_unspace(type, datum)
spaced_type?(type) ? datum.gsub(/^(\d+)\s+(\d+)\s+(\d+)\s+(\w+)\s+(\w+)$/, '\1 \2 \3 \4\5') : datum
if spaced_type?(type)
case type
when 'DS', 'TLSA'
datum.gsub(/^(\d+)\s+(\d+)\s+(\d+)\s+(\w+)\s+(\w+)$/, '\1 \2 \3 \4\5')
when 'SSHFP'
datum.gsub(/^(\d+)\s+(\d+)\s+(\w+)\s+(\w+)$/, '\1 \2 \3\4')
end
else
datum
end
end
def rrdata_adds