Commit 16e5ccdc authored by Daniel Salzman's avatar Daniel Salzman

conf: add partial migration support for renamed modules

parent 6ff0d1ad
/* Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2017 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -131,3 +131,37 @@ int conf_migrate(
return conf_refresh_txn(conf);
}
const yp_item_t scheme_mod_online_sign[] = {
{ C_ID, YP_TSTR },
{ C_POLICY, YP_TSTR },
{ C_COMMENT, YP_TSTR },
{ NULL }
};
int check_mod_online_sign(
knotd_conf_check_args_t *args)
{
CONF_LOG(LOG_WARNING, "module 'mod-online-sign' must be renamed 'mod-onlinesign'");
return KNOT_EOK;
}
const yp_item_t scheme_mod_synth_record[] = {
{ C_ID, YP_TSTR },
{ "\x07""network", YP_TSTR },
{ "\x06""origin", YP_TSTR },
{ "\x06""prefix", YP_TSTR },
{ "\x03""ttl", YP_TSTR },
{ "\x04""type", YP_TSTR },
{ C_COMMENT, YP_TSTR },
{ NULL }
};
int check_mod_synth_record(
knotd_conf_check_args_t *args)
{
CONF_LOG(LOG_WARNING, "module 'mod-synth_record' must be renamed 'mod-synthrecord'");
return KNOT_EOK;
}
/* Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2017 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -28,3 +28,11 @@
int conf_migrate(
conf_t *conf
);
#define C_MOD_ONLINE_SIGN "\x0f""mod-online-sign"
extern const yp_item_t scheme_mod_online_sign[];
int check_mod_online_sign(knotd_conf_check_args_t *args);
#define C_MOD_SYNTH_RECORD "\x10""mod-synth-record"
extern const yp_item_t scheme_mod_synth_record[];
int check_mod_synth_record(knotd_conf_check_args_t *args);
......@@ -21,6 +21,7 @@
#include "knot/conf/scheme.h"
#include "knot/conf/confio.h"
#include "knot/conf/migration.h"
#include "knot/conf/tools.h"
#include "knot/common/log.h"
#include "knot/journal/journal.h"
......@@ -296,5 +297,8 @@ const yp_item_t conf_scheme[] = {
{ C_TPL, YP_TGRP, YP_VGRP = { desc_template }, YP_FMULTI, { check_template } },
{ C_ZONE, YP_TGRP, YP_VGRP = { desc_zone }, YP_FMULTI | CONF_IO_FZONE, { check_zone } },
{ C_INCL, YP_TSTR, YP_VNONE, CONF_IO_FDIFF_ZONES | CONF_IO_FRLD_ALL, { include_file } },
/* Renamed modules. */
{ C_MOD_ONLINE_SIGN, YP_TGRP, YP_VGRP = { scheme_mod_online_sign }, YP_FMULTI, { check_mod_online_sign } },
{ C_MOD_SYNTH_RECORD, YP_TGRP, YP_VGRP = { scheme_mod_synth_record }, YP_FMULTI, { check_mod_synth_record } },
{ NULL }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment