1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

import_transform can define ttl as third parameter (#5)

This commit is contained in:
Craig Peterson
2016-09-28 12:45:59 -06:00
committed by GitHub
parent 03d30b02c7
commit dd538e6693
5 changed files with 74 additions and 40 deletions

View File

@ -176,10 +176,13 @@ function format_tt(transform_table) {
}
// IMPORT_TRANSFORM(translation_table, domain)
function IMPORT_TRANSFORM(translation_table, domain) {
function IMPORT_TRANSFORM(translation_table, domain,ttl) {
return function(d) {
addRecord(d, "IMPORT_TRANSFORM", "@", domain, [
var rec = addRecord(d, "IMPORT_TRANSFORM", "@", domain, [
{'transform_table': format_tt(translation_table)}])
if (ttl){
rec.ttl = ttl;
}
}
}
@ -231,6 +234,7 @@ function addRecord(d,type,name,target,mods) {
}
}
d.records.push(rec);
return rec;
}
//ip conversion functions from http://stackoverflow.com/a/8105740/121660