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

Merge branch 'keymgr_d_deprecate' into 'master'

keymgr: new -D param instead of deprecated -d

See merge request !1359
parents a70b7180 29decc3e
No related branches found
No related tags found
1 merge request!1359keymgr: new -D param instead of deprecated -d
Pipeline #87825 failed
......@@ -83,7 +83,7 @@ Use a binary configuration database directory (default is \fB@storage_dir@/confd
The default configuration database, if exists, has a preference to the default
configuration file.
.TP
\fB\-d\fP, \fB\-\-dir\fP \fIpath\fP
\fB\-D\fP, \fB\-\-dir\fP \fIpath\fP
Use specified KASP database path and default configuration.
.UNINDENT
.sp
......
......@@ -60,7 +60,7 @@ Config options
The default configuration database, if exists, has a preference to the default
configuration file.
**-d**, **--dir** *path*
**-D**, **--dir** *path*
Use specified KASP database path and default configuration.
.. NOTE::
......
......@@ -20,7 +20,8 @@
#include "knot/dnssec/context.h"
#define ERROR(msg, ...) { fprintf(stderr, "Error: " msg, ##__VA_ARGS__); fflush(stderr); }
#define ERROR(msg, ...) { fprintf(stderr, "Error: " msg, ##__VA_ARGS__); fflush(stderr); }
#define WARNING(msg, ...) { fprintf(stderr, "Warning: " msg, ##__VA_ARGS__); fflush(stderr); }
typedef struct {
knot_time_print_t format;
......
......@@ -47,7 +47,7 @@ static void print_help(void)
" (default %s)\n"
" -C, --confdb <dir> Use a binary configuration database directory.\n"
" (default %s)\n"
" -d, --dir <path> Use specified KASP database path and default configuration.\n"
" -D, --dir <path> Use specified KASP database path and default configuration.\n"
" -t, --tsig <name> [alg] Generate a TSIG key.\n"
" -l, --list List all zones that have at least one key in KASP database.\n"
" -x, --mono Don't color the output.\n"
......@@ -369,7 +369,7 @@ int main(int argc, char *argv[])
struct option opts[] = {
{ "config", required_argument, NULL, 'c' },
{ "confdb", required_argument, NULL, 'C' },
{ "dir", required_argument, NULL, 'd' },
{ "dir", required_argument, NULL, 'D' },
{ "tsig", required_argument, NULL, 't' },
{ "brief", no_argument, NULL, 'b' },
{ "list", no_argument, NULL, 'l' },
......@@ -389,7 +389,7 @@ int main(int argc, char *argv[])
list_params.color = isatty(STDOUT_FILENO);
int opt = 0, parm = 0;
while ((opt = getopt_long(argc, argv, "hVd:c:C:t:lbxX", opts, NULL)) != -1) {
while ((opt = getopt_long(argc, argv, "hVd:D:c:C:t:lbxX", opts, NULL)) != -1) {
switch (opt) {
case 'h':
print_help();
......@@ -398,6 +398,9 @@ int main(int argc, char *argv[])
print_version(PROGRAM_NAME);
return EXIT_SUCCESS;
case 'd':
WARNING("keymgr -d is deprecated, use -D option instead\n");
// FALLTHROUGH
case 'D':
CHECK_CONF_UNINIT
if (!init_conf(NULL) || !init_conf_blank(optarg)) {
return EXIT_FAILURE;
......@@ -450,7 +453,7 @@ int main(int argc, char *argv[])
init_conf(NULL) && init_confile(CONF_DEFAULT_FILE)) {
// initialized conf from default confile
} else {
ERROR("couldn't initialize configuration, please provide -c, -C, or -d option\n");
ERROR("couldn't initialize configuration, please provide -c, -C, or -D option\n");
return EXIT_FAILURE;
}
}
......
......@@ -14,7 +14,7 @@ import subprocess
import random
def check_keys(server, zone_name, expect_keys):
cmd = Popen([dnstest.params.keymgr_bin, "-d", server.dir + "/keys", zone_name, "list"], stdout=PIPE, stderr=PIPE, universal_newlines=True)
cmd = Popen([dnstest.params.keymgr_bin, "-D", server.dir + "/keys", zone_name, "list"], stdout=PIPE, stderr=PIPE, universal_newlines=True)
(stdout, stderr) = cmd.communicate()
lines = len(stdout.splitlines())
if lines != expect_keys:
......
......@@ -14,7 +14,7 @@ import subprocess
import random
def check_keys(server, zone_name, expect_keys):
cmd = Popen([dnstest.params.keymgr_bin, "-d", server.dir + "/keys", zone_name, "list"], \
cmd = Popen([dnstest.params.keymgr_bin, "-D", server.dir + "/keys", zone_name, "list"], \
stdout=PIPE, stderr=PIPE, universal_newlines=True)
(stdout, stderr) = cmd.communicate()
lines = len(stdout.splitlines())
......
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