diff mbox series

[ovs-dev,ovn] ovn-nbctl: Add some hint for --ecmp in error message.

Message ID 1592616319-10646-1-git-send-email-hzhou@ovn.org
State Accepted
Headers show
Series [ovs-dev,ovn] ovn-nbctl: Add some hint for --ecmp in error message. | expand

Commit Message

Han Zhou June 20, 2020, 1:25 a.m. UTC
Add the hint to remind user about --ecmp option when needed.

Signed-off-by: Han Zhou <hzhou@ovn.org>
---
 tests/ovn-nbctl.at    | 2 +-
 utilities/ovn-nbctl.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Han Zhou Aug. 5, 2020, 6:53 p.m. UTC | #1
On Fri, Jun 19, 2020 at 6:25 PM Han Zhou <hzhou@ovn.org> wrote:
>
> Add the hint to remind user about --ecmp option when needed.
>
> Signed-off-by: Han Zhou <hzhou@ovn.org>

This patch needs a review. It seems to be forgotten.

Thanks,
Han

> ---
>  tests/ovn-nbctl.at    | 2 +-
>  utilities/ovn-nbctl.c | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
> index 14de1a8..54b4ad2 100644
> --- a/tests/ovn-nbctl.at
> +++ b/tests/ovn-nbctl.at
> @@ -1414,7 +1414,7 @@ AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.1/24
11.0.0.2])
>
>  dnl Add overlapping route with 10.0.0.1/24
>  AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.111/24 11.0.0.1], [1], [],
> -  [ovn-nbctl: duplicate prefix: 10.0.0.0/24 (policy: dst-ip)
> +  [ovn-nbctl: duplicate prefix: 10.0.0.0/24 (policy: dst-ip). Use option
--ecmp to allow this for ECMP routing.
>  ])
>  AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.111a/24 11.0.0.1], [1], [],
>    [ovn-nbctl: bad prefix argument: 10.0.0.111a/24
> diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
> index 6ccc702..75fd8f9 100644
> --- a/utilities/ovn-nbctl.c
> +++ b/utilities/ovn-nbctl.c
> @@ -3833,7 +3833,8 @@ nbctl_lr_route_add(struct ctl_context *ctx)
>              }
>
>              if (!may_exist) {
> -                ctl_error(ctx, "duplicate prefix: %s (policy: %s)",
> +                ctl_error(ctx, "duplicate prefix: %s (policy: %s). Use
option"
> +                          " --ecmp to allow this for ECMP routing.",
>                            prefix, is_src_route ? "src-ip" : "dst-ip");
>                  free(next_hop);
>                  free(rt_prefix);
> --
> 2.1.0
>
Dumitru Ceara Aug. 7, 2020, 7:39 a.m. UTC | #2
On 6/20/20 3:25 AM, Han Zhou wrote:
> Add the hint to remind user about --ecmp option when needed.
> 
> Signed-off-by: Han Zhou <hzhou@ovn.org>

Hi Han,

Looks good to me.

Acked-by: Dumitru Ceara <dceara@redhat.com>

Thanks,
Dumitru
Han Zhou Aug. 8, 2020, 1:06 a.m. UTC | #3
On Fri, Aug 7, 2020 at 12:40 AM Dumitru Ceara <dceara@redhat.com> wrote:

> On 6/20/20 3:25 AM, Han Zhou wrote:
> > Add the hint to remind user about --ecmp option when needed.
> >
> > Signed-off-by: Han Zhou <hzhou@ovn.org>
>
> Hi Han,
>
> Looks good to me.
>
> Acked-by: Dumitru Ceara <dceara@redhat.com>
>
> Thanks,
> Dumitru
>

Thanks Dumitru, I applied to master.
diff mbox series

Patch

diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
index 14de1a8..54b4ad2 100644
--- a/tests/ovn-nbctl.at
+++ b/tests/ovn-nbctl.at
@@ -1414,7 +1414,7 @@  AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.1/24 11.0.0.2])
 
 dnl Add overlapping route with 10.0.0.1/24
 AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.111/24 11.0.0.1], [1], [],
-  [ovn-nbctl: duplicate prefix: 10.0.0.0/24 (policy: dst-ip)
+  [ovn-nbctl: duplicate prefix: 10.0.0.0/24 (policy: dst-ip). Use option --ecmp to allow this for ECMP routing.
 ])
 AT_CHECK([ovn-nbctl lr-route-add lr0 10.0.0.111a/24 11.0.0.1], [1], [],
   [ovn-nbctl: bad prefix argument: 10.0.0.111a/24
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index 6ccc702..75fd8f9 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -3833,7 +3833,8 @@  nbctl_lr_route_add(struct ctl_context *ctx)
             }
 
             if (!may_exist) {
-                ctl_error(ctx, "duplicate prefix: %s (policy: %s)",
+                ctl_error(ctx, "duplicate prefix: %s (policy: %s). Use option"
+                          " --ecmp to allow this for ECMP routing.",
                           prefix, is_src_route ? "src-ip" : "dst-ip");
                 free(next_hop);
                 free(rt_prefix);