Re: [test-API PATCH 2/2] parser: put the syntax checking to testcase line at end of flags checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/13/2012 09:56 AM, Guannan Ren wrote:
>     we use the "re.match(".+:.+", tripped_casename)" only check testcase
>     name line, such as domain:start, we don't want it to check flag.
>     placing it just after flags checking is right place.
> ---
>  parser.py |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/parser.py b/parser.py
> index 18f6ccd..e569d7f 100644
> --- a/parser.py
> +++ b/parser.py
> @@ -327,8 +327,6 @@ class CaseFileParser(object):
>  
>                  tripped_caselist = casestring.strip().split()
>                  tripped_casename = tripped_caselist[0]
> -                if not re.match(".+:.+", tripped_casename):
> -                    raise exception.CaseConfigfileError("casename line format error!")
>  
>                  if self.debug:
>                      self.debug_print("we begin to handle the case",
> @@ -416,6 +414,9 @@ class CaseFileParser(object):
>                      list.append(option_case)
>                      continue
>  
> +                if not re.match(".+:.+", tripped_casename):
> +                    raise exception.CaseConfigfileError("%s line format error!" % tripped_casename)
> +
>                  for caselist in list:
>                      newdict = {}
>                      newdict[tripped_casename] = {}

I think both of these are fine, ACK series.

Martin

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]