Skip to content

Commit

Permalink
ovn-nbctl: Don't parse table-formatting options in nbctl_client
Browse files Browse the repository at this point in the history
When ovn-nbctl is running in daemon mode, nbctl_client attempts to parse
table formatting options. The problem is that this then removes the table
formatting options from the array of options passed to the server loop. The
server loop resets the table formatting options to the defaults and then
attempts again to parse table formatting options. Unfortunately, they aren't
present any longer. The result is that tables are always formatted with
the default style.

This patch solves the issue by not parsing the table formatting options
in nbctl_client. Instead, the table formatting options are passed to the
server loop and parsed there instead.

Signed-off-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
putnopvut authored and blp committed Oct 8, 2018
1 parent d9cf9b2 commit d348d03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion ovn/utilities/ovn-nbctl.c
Expand Up @@ -5443,7 +5443,6 @@ nbctl_client(const char *socket_name,
break;

VLOG_OPTION_HANDLERS
TABLE_OPTION_HANDLERS(&table_style)

case OPT_LOCAL:
default:
Expand Down
9 changes: 9 additions & 0 deletions tests/ovn-nbctl.at
Expand Up @@ -1530,3 +1530,12 @@ name : "sw1"
AT_CHECK([ovn-nbctl --columns=name list logical_switch sw1], [0], [dnl
name : "sw1"
])])

OVN_NBCTL_TEST([ovn_nbctl_table_formatting], [table formatting], [
dnl This test addresses a specific issue seen when running ovn-nbctl in
dnl daemon mode. We need to ensure that table formatting options are honored
dnl when listing database information.
AT_CHECK([ovn-nbctl ls-add sw1], [0], [ignore])
AT_CHECK([ovn-nbctl --bare --columns=name list logical_switch sw1], [0], [dnl
sw1
])])

0 comments on commit d348d03

Please sign in to comment.