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@xxxxxxxxxx> > --- > 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@xxxxxxxxxx > https://www.redhat.com/mailman/listinfo/virt-tools-list
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list