[ovs-dev,2/4] extract-ofp-errors: Minor improvements.

Message ID 20180208231849.31519-2-blp@ovn.org
State Accepted
Headers show
Series
  • [ovs-dev,1/4] Implement OF1.3 extension for OF1.4 role status feature.
Related show

Commit Message

Ben Pfaff Feb. 8, 2018, 11:18 p.m.
This removes the requirement of exactly two spaces before the error
description (now one or more is fine).  It also makes an error message
clearer.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 build-aux/extract-ofp-errors | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

William Tu Feb. 13, 2018, 7:13 p.m. | #1
On Thu, Feb 8, 2018 at 3:18 PM, Ben Pfaff <blp@ovn.org> wrote:
> This removes the requirement of exactly two spaces before the error
> description (now one or more is fine).  It also makes an error message
> clearer.
>
> Signed-off-by: Ben Pfaff <blp@ovn.org>
> ---

Looks good to me.
Acked-by: William Tu <u9012063@gmail.com>

>  build-aux/extract-ofp-errors | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors
> index 71ae0bd5f0ff..6c14f68b883a 100755
> --- a/build-aux/extract-ofp-errors
> +++ b/build-aux/extract-ofp-errors
> @@ -247,7 +247,7 @@ def extract_ofp_errors(fn):
>              expected_errors[m.group(1)] = (fileName, lineNumber)
>              continue
>
> -        m = re.match('((?:.(?!\.  ))+.)\.  (.*)$', comment)
> +        m = re.match('((?:.(?!\.  ))+.)\.\s+(.*)$', comment)
>          if not m:
>              fatal("unexpected syntax between errors")
>
> @@ -257,7 +257,7 @@ def extract_ofp_errors(fn):
>          m = re.match('\s+(?:OFPERR_([A-Z0-9_]+))(\s*=\s*OFPERR_OFS)?,',
>                       line)
>          if not m:
> -            fatal("syntax error expecting enum value")
> +            fatal("syntax error expecting OFPERR_ enum value")
>
>          enum = m.group(1)
>          if enum in names:
> --
> 2.15.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Patch

diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors
index 71ae0bd5f0ff..6c14f68b883a 100755
--- a/build-aux/extract-ofp-errors
+++ b/build-aux/extract-ofp-errors
@@ -247,7 +247,7 @@  def extract_ofp_errors(fn):
             expected_errors[m.group(1)] = (fileName, lineNumber)
             continue
 
-        m = re.match('((?:.(?!\.  ))+.)\.  (.*)$', comment)
+        m = re.match('((?:.(?!\.  ))+.)\.\s+(.*)$', comment)
         if not m:
             fatal("unexpected syntax between errors")
 
@@ -257,7 +257,7 @@  def extract_ofp_errors(fn):
         m = re.match('\s+(?:OFPERR_([A-Z0-9_]+))(\s*=\s*OFPERR_OFS)?,',
                      line)
         if not m:
-            fatal("syntax error expecting enum value")
+            fatal("syntax error expecting OFPERR_ enum value")
 
         enum = m.group(1)
         if enum in names: