[PATCH] Add a length check to the timestamp version detection. (#1194494)

Anne Mulhern amulhern at redhat.com
Fri Feb 20 15:06:19 UTC 2015





----- Original Message -----
> From: "David Shea" <dshea at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Friday, February 20, 2015 9:09:31 AM
> Subject: [PATCH] Add a length check to the timestamp version detection.	(#1194494)
> 
> '22' is not a timestamp.
> ---
>  pyanaconda/packaging/__init__.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/pyanaconda/packaging/__init__.py
> b/pyanaconda/packaging/__init__.py
> index e4a9a63..2af5a9a 100644
> --- a/pyanaconda/packaging/__init__.py
> +++ b/pyanaconda/packaging/__init__.py
> @@ -397,7 +397,7 @@ class Payload(object):
>  
>          # If the version looks like a timestamp, assume it's rawhide
>          # plz change before Fedora version 9999999
> -        if version[:8].isdigit():
> +        if len(version) > 7 and version[:8].isdigit():
>              version = "rawhide"
>  
>          log.debug("got a release version of %s", version)
> --
> 2.1.0
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

It's probably more correct to use a regular expression, at this point.

- mulhern


More information about the anaconda-patches mailing list