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 <taoyunxi...@cmss.chinamobile.com>
Signed-off-by: Tao YunXiang <taoyunxi...@cmss.chinamobile.com>
CC: Dumitru Ceara <dce...@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");
+            }
+
     /* If match is not specified, delete all routing policies with the
      * specified priority. */
         } else {
-- 
2.17.1



_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to