diff options
author | Mark Michelson <mmichels@redhat.com> | 2018-10-08 14:49:07 -0400 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-10-08 12:38:03 -0700 |
commit | d9cf9b2d8bda4b97fd72ef1420085e4193f81deb (patch) | |
tree | 98d70a9ca4532a63b4129016cc0cc5396859bd0e /ovn | |
parent | b2b3f8ce30b03673a8fbd6678a8aa431cc3b402c (diff) | |
download | openvswitch-d9cf9b2d8bda4b97fd72ef1420085e4193f81deb.tar.gz |
table: Create method for resetting table formatting.
Table formatting has a local static integer that is intended to insert
line breaks between tables. This works exactly as intended, as long as
each call to table_format() is done as a single unit within the run of a
process.
When ovn-nbctl is run in daemon mode, it is a long-running process that
makes multiple calls to table_format() throughout its lifetime. After
the first call, this results in an unexpected newline prepended to table
output on each subsequent ovn-nbctl invocation.
The solution is to introduce a function to reset table formatting. This
way, the first time after resetting table formatting, no newline is
prepended.
Signed-off-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r-- | ovn/utilities/ovn-nbctl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c index eabd30308..d65a9ba08 100644 --- a/ovn/utilities/ovn-nbctl.c +++ b/ovn/utilities/ovn-nbctl.c @@ -5311,6 +5311,7 @@ server_cmd_run(struct unixctl_conn *conn, int argc, const char **argv_, } struct ds output = DS_EMPTY_INITIALIZER; + table_format_reset(); for (struct ctl_command *c = commands; c < &commands[n_commands]; c++) { if (c->table) { table_format(c->table, &table_style, &output); |