[virt-tools-list] [virt-manager PATCH v2 2/3] osdict: adapt latest_regex() to openSUSE's versioning

Pavel Hrdina phrdina at redhat.com
Fri Nov 16 10:13:38 UTC 2018


On Fri, Oct 19, 2018 at 06:54:53PM +0200, Fabiano Fidêncio wrote:
> Due to OpenSUSE's decision of versioning their OS as 11.x, 12.x, 42.x,
> 15.x, we have to add a specific check in latest_regex() in order to make
> sure we skip the 42.x series in the sorted list of OSes when returning
> the OS name to the user.
> 
> Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
> ---
>  virtinst/osdict.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/virtinst/osdict.py b/virtinst/osdict.py
> index 49085e6d..ec9aa430 100644
> --- a/virtinst/osdict.py
> +++ b/virtinst/osdict.py
> @@ -238,6 +238,15 @@ class _OSDB(object):
>          oses = [o.name for o in self.list_os() if re.match(regex, o.name)]
>          if not oses:
>              return None
> +
> +        # OpenSUSE's decision of having their versioning as 11.x, 12.x, 42.x,
> +        # 15.x forces us to have this specific check for then.
> +        # Knowing that 42 series was composed of 42.[1-3] and that the series
> +        # will not have any more release, we can safely return the 4th element
> +        # of the oses

Missing dot at the end of sentence :), I'll fix that before pusing.

Pavel

> +        if regex.startswith("opensuse"):
> +            return oses[3]
> +
>          return oses[0]
>  
>      def latest_os_version(self, osdistro):
> -- 
> 2.19.1
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20181116/a157e6c1/attachment.sig>


More information about the virt-tools-list mailing list