Skip to content

Commit

Permalink
netdev-vport: Do not log empty warnings on success.
Browse files Browse the repository at this point in the history
set_tunnel_config() always logs a warning, even on success. This
shouldn't happen.

Without this, some unit tests fail.

Fixes: 9fff138("netdev: Add 'errp' to set_config().")
Signed-off-by: Daniele Di Proietto <[email protected]>
Acked-by: Antonio Fischetti <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
ddiproietto committed Jan 12, 2017
1 parent 2d9b49d commit c296d3f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/netdev-vport.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,12 @@ set_tunnel_config(struct netdev *dev_, const struct smap *args, char **errp)
err = 0;

out:
ds_chomp(&errors, '\n');
VLOG_WARN("%s", ds_cstr(&errors));
if (err) {
*errp = ds_steal_cstr(&errors);
if (errors.length) {
ds_chomp(&errors, '\n');
VLOG_WARN("%s", ds_cstr(&errors));
if (err) {
*errp = ds_steal_cstr(&errors);
}
}

ds_destroy(&errors);
Expand Down

0 comments on commit c296d3f

Please sign in to comment.