diff mbox

[ovs-dev,11/27] ovn-nbctl: Omit "addresses: ["router"]" from "show" output.

Message ID 20170430232231.15151-12-blp@ovn.org
State Accepted
Headers show

Commit Message

Ben Pfaff April 30, 2017, 11:22 p.m. UTC
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 ovn/utilities/ovn-nbctl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Andy Zhou May 3, 2017, 7:30 a.m. UTC | #1
On Sun, Apr 30, 2017 at 4:22 PM, Ben Pfaff <blp@ovn.org> wrote:
> Signed-off-by: Ben Pfaff <blp@ovn.org>


Acked-by: Andy Zhou <azhou@ovn.org>
diff mbox

Patch

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index cc0ab15c9442..cfa1c525f77c 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -622,7 +622,12 @@  print_ls(const struct nbrec_logical_switch *ls, struct ds *s)
         if (lsp->n_tag) {
             ds_put_format(s, "        tag: %"PRIu64"\n", lsp->tag[0]);
         }
-        if (lsp->n_addresses) {
+
+        /* Print the addresses, but not if there's just a single "router"
+         * address because that's just clutter. */
+        if (lsp->n_addresses
+            && !(lsp->n_addresses == 1
+                 && !strcmp(lsp->addresses[0], "router"))) {
             ds_put_cstr(s, "        addresses: [");
             for (size_t j = 0; j < lsp->n_addresses; j++) {
                 ds_put_format(s, "%s\"%s\"",