summaryrefslogtreecommitdiff
path: root/vtep
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-05-17 14:04:25 -0700
committerBen Pfaff <blp@ovn.org>2018-05-25 14:25:54 -0700
commit15f6255fdd0df369909ab8e524d0d174537b2a65 (patch)
tree192513485b10e932fa5ec63e56ea4ef3f0875128 /vtep
parent2128f9b4d2a4ab0f969c3e02f1ad22abae1a581a (diff)
downloadopenvswitch-15f6255fdd0df369909ab8e524d0d174537b2a65.tar.gz
ovs-vsctl, ovn-nbctl, ovn-sbctl, vtep-ctl: Parse options before logging.
These utilities logged the command very early, before parsing the options or the command. This meant that logging options (like --log-file or -vsyslog:off) weren't considered for the purpose of logging the command. This fixes the problem. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'vtep')
-rw-r--r--vtep/vtep-ctl.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c
index 0ae7d4621..c89ec5034 100644
--- a/vtep/vtep-ctl.c
+++ b/vtep/vtep-ctl.c
@@ -99,7 +99,6 @@ main(int argc, char *argv[])
struct shash local_options;
unsigned int seqno;
size_t n_commands;
- char *args;
set_program_name(argv[0]);
fatal_ignore_sigpipe();
@@ -108,15 +107,14 @@ main(int argc, char *argv[])
vtep_ctl_cmd_init();
- /* Log our arguments. This is often valuable for debugging systems. */
- args = process_escape_args(argv);
- VLOG(ctl_might_write_to_db(argv) ? VLL_INFO : VLL_DBG, "Called as %s", args);
-
/* Parse command line. */
+ char *args = process_escape_args(argv);
shash_init(&local_options);
parse_options(argc, argv, &local_options);
commands = ctl_parse_commands(argc - optind, argv + optind, &local_options,
&n_commands);
+ VLOG(ctl_might_write_to_db(commands, n_commands) ? VLL_INFO : VLL_DBG,
+ "Called as %s", args);
if (timeout) {
time_alarm(timeout);