Skip to content

Commit

Permalink
ovn-nbctl: Print empty string for non-existent external-id.
Browse files Browse the repository at this point in the history
Instead of printing a message for a non-existent requested key, just
print an empty string.  This mimics the behavior of ovs-vsctl.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
  • Loading branch information
Justin Pettit committed Apr 17, 2015
1 parent c845379 commit ee98038
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ovn/ovn-nbctl.c
Expand Up @@ -203,10 +203,8 @@ do_lswitch_get_external_id(struct ovs_cmdl_context *ctx)
/* List one external ID */

value = smap_get(&lswitch->external_ids, key);
if (value && *value) {
if (value) {
printf("%s\n", value);
} else {
printf("external-id '%s' is not set.\n", key);
}
} else {
struct smap_node *node;
Expand Down Expand Up @@ -361,10 +359,8 @@ do_lport_get_external_id(struct ovs_cmdl_context *ctx)
/* List one external ID */

value = smap_get(&lport->external_ids, key);
if (value && *value) {
if (value) {
printf("%s\n", value);
} else {
printf("external-id '%s' is not set.\n", key);
}
} else {
struct smap_node *node;
Expand Down

0 comments on commit ee98038

Please sign in to comment.