From: Eric Bollengier Date: Fri, 27 Nov 2015 09:44:44 +0000 (+0100) Subject: Fix #1470 Fix setdebug command when all components are selected X-Git-Tag: Release-7.4.0~112 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5448e50848c89a8a8fd6990236d18b048efdead1;p=bacula%2Fbacula Fix #1470 Fix setdebug command when all components are selected Only the debug_level is set on the director side when we use "All" menu. Now, we also update options, tags, and trace option. --- diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 01a7e8f92d..0774d316ca 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -914,6 +914,14 @@ static int disable_cmd(UAContext *ua, const char *cmd) return 1; } +static void do_dir_setdebug(UAContext *ua, int64_t level, int trace_flag, char *options, int64_t tags) +{ + debug_level = level; + debug_level_tags = tags; + set_trace(trace_flag); + set_debug_flags(options); +} + static void do_storage_setdebug(UAContext *ua, STORE *store, int64_t level, int trace_flag, int hangup, int blowup, char *options, char *tags) @@ -999,9 +1007,11 @@ static void do_all_setdebug(UAContext *ua, int64_t level, STORE *store, **unique_store; CLIENT *client, **unique_client; int i, j, found; + int64_t t=0; /* Director */ - debug_level = level; + debug_parse_tags(tags, &t); + do_dir_setdebug(ua, level, trace_flag, options, t); /* Count Storage items */ LockRes(); @@ -1149,10 +1159,7 @@ static int setdebug_cmd(UAContext *ua, const char *cmd) } if (strcasecmp(ua->argk[i], "dir") == 0 || strcasecmp(ua->argk[i], "director") == 0) { - debug_level = level; - debug_level_tags = tags; - set_trace(trace_flag); - set_debug_flags(options); + do_dir_setdebug(ua, level, trace_flag, options, tags); return 1; } if (strcasecmp(ua->argk[i], "client") == 0 || @@ -1205,9 +1212,7 @@ static int setdebug_cmd(UAContext *ua, const char *cmd) add_prompt(ua, _("All")); switch(do_prompt(ua, "", _("Select daemon type to set debug level"), NULL, 0)) { case 0: /* Director */ - debug_level = level; - set_trace(trace_flag); - set_debug_flags(options); + do_dir_setdebug(ua, level, trace_flag, options, tags); break; case 1: store = get_storage_resource(ua, false/*no default*/, true/*unique*/);