diff mbox series

[ovs-dev,OVN,v3] ovn-nbctl.c: Fix lr-policy-del command

Message ID 20200515081328.8152-1-taoyunxiang@cmss.chinamobile.com
State Accepted
Headers show
Series [ovs-dev,OVN,v3] ovn-nbctl.c: Fix lr-policy-del command | expand

Commit Message

taoyunxiang May 15, 2020, 8:13 a.m. UTC
This change will check the existence of lr-policy uuid.
If not, it will print "uuid is not found".

Fixes: 1b030874c32("ovn-nbctl.c: Add an optional way to delete router policy by uuid")


Author: Tao YunXiang <taoyunxiang@cmss.chinamobile.com>
Signed-off-by: Tao YunXiang <taoyunxiang@cmss.chinamobile.com>
CC: Dumitru Ceara <dceara@redhat.com>

---
 utilities/ovn-nbctl.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Numan Siddique May 15, 2020, 4:14 p.m. UTC | #1
On Fri, May 15, 2020 at 1:45 PM Tao YunXiang <
taoyunxiang@cmss.chinamobile.com> wrote:

> This change will check the existence of lr-policy uuid.
> If not, it will print "uuid is not found".
>
> Fixes: 1b030874c32("ovn-nbctl.c: Add an optional way to delete router
> policy by uuid")
>
>
> Author: Tao YunXiang <taoyunxiang@cmss.chinamobile.com>
> Signed-off-by: Tao YunXiang <taoyunxiang@cmss.chinamobile.com>
> CC: Dumitru Ceara <dceara@redhat.com>
>
> ---
>  utilities/ovn-nbctl.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
> index f4da7c8ed..185146ac9 100644
> --- a/utilities/ovn-nbctl.c
> +++ b/utilities/ovn-nbctl.c
> @@ -3647,6 +3647,10 @@ nbctl_lr_policy_del(struct ctl_context *ctx)
>                      new_policies[n_policies++] = lr->policies[i];
>                  }
>              }
> +            if (n_policies == lr->n_policies) {
> +                ctl_error(ctx, "uuid is not found");
> +            }
>

Thanks for the patch.

I applied this patch to master with the below 2 changes

--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -3648,7 +3648,7 @@ nbctl_lr_policy_del(struct ctl_context *ctx)
                 }
             }
             if (n_policies == lr->n_policies) {
-                ctl_error(ctx, "uuid is not found");
+                ctl_error(ctx, "Logical router policy uuid is not found.");
+                return;
             }


Thanks
Numan


> +
>      /* If match is not specified, delete all routing policies with the
>       * specified priority. */
>          } else {
> --
> 2.17.1
>
>
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
diff mbox series

Patch

diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index f4da7c8ed..185146ac9 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -3647,6 +3647,10 @@  nbctl_lr_policy_del(struct ctl_context *ctx)
                     new_policies[n_policies++] = lr->policies[i];
                 }
             }
+            if (n_policies == lr->n_policies) {
+                ctl_error(ctx, "uuid is not found");
+            }
+
     /* If match is not specified, delete all routing policies with the
      * specified priority. */
         } else {