diff mbox series

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

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

Commit Message

taoyunxiang May 13, 2020, 2:03 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>
---
 utilities/ovn-nbctl.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Dumitru Ceara May 13, 2020, 1:05 p.m. UTC | #1
On 5/13/20 4:03 AM, Tao YunXiang 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>
> ---
>  utilities/ovn-nbctl.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
> index 67b23108f..2dabd27de 100644
> --- a/utilities/ovn-nbctl.c
> +++ b/utilities/ovn-nbctl.c
> @@ -3642,6 +3642,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");
> +                }
> +

Hi Tao,

The indentation here looks a bit weird, the closing '}' should be 4
spaces to the left.

>      /* If match is not specified, delete all routing policies with the
>       * specified priority. */

Could you also please fix the indentation for this comment?

Thanks,
Dumitru

>          } else {
>
taoyunxiang May 15, 2020, 2:39 a.m. UTC | #2
Hi Dumitru,
                I have fixed it , and summit v2. Thanks for your review.

Regards,
Yun

--------------
taoyunxiang@cmss.chinamobile.com
>On 5/13/20 4:03 AM, Tao YunXiang 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>
>> ---
>>  utilities/ovn-nbctl.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
>> index 67b23108f..2dabd27de 100644
>> --- a/utilities/ovn-nbctl.c
>> +++ b/utilities/ovn-nbctl.c
>> @@ -3642,6 +3642,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");
>> +                }
>> +
>
>Hi Tao,
>
>The indentation here looks a bit weird, the closing '}' should be 4
>spaces to the left.
>
>>      /* If match is not specified, delete all routing policies with the
>>       * specified priority. */
>
>Could you also please fix the indentation for this comment?
>
>Thanks,
>Dumitru
>
>>          } else {
>>
>
diff mbox series

Patch

diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index 67b23108f..2dabd27de 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -3642,6 +3642,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 {