Skip to content
Snippets Groups Projects
Commit 94599275 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Merge branch 'restore_zf_mk_path' into 'master'

backup: create dir path when restoring zonefile

See merge request !1196
parents 95ed8495 0ca60b17
No related branches found
No related tags found
1 merge request!1196backup: create dir path when restoring zonefile
Pipeline #70283 passed
......@@ -252,7 +252,10 @@ int zone_backup(conf_t *conf, zone_t *zone)
char *backup_zf = dir_file(ctx->backup_dir, local_zf);
if (ctx->restore_mode) {
ret = copy_file(local_zf, backup_zf);
ret = make_path(local_zf, S_IRWXU | S_IRWXG);
if (ret == KNOT_EOK) {
ret = copy_file(local_zf, backup_zf);
}
} else {
conf_val_t val = conf_zone_get(conf, C_ZONEFILE_SYNC, zone->name);
bool can_flush = (conf_int(&val) > -1);
......
......@@ -69,6 +69,7 @@ if dnskey1_2 == dnskey1_1 or dnskey2_2 == dnskey2_1:
test_added(master, zones, [ "NXDOMAIN", "NXDOMAIN" ])
shutil.rmtree(master.dir + "/master")
master.ctl("zone-restore +backupdir %s %s" % (backup_dir, zones[0].name), wait=True)
t.sleep(5)
......@@ -81,6 +82,7 @@ if dnskey2_3 == dnskey2_1:
test_added(master, zones, [ "NOERROR", "NXDOMAIN" ])
master.ctl("zone-restore +backupdir %s %s" % (backup_dir, zones[1].name), wait=True)
master.stop()
keydir = master.keydir # BEWARE this is function invocation
shutil.rmtree(keydir)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment