Re: [virt-manager PATCH] osdict: Use identify_tree() instead of guess_os_from_tree()

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

 



On Wed, Jun 26, 2019 at 4:38 PM Cole Robinson <crobinso@xxxxxxxxxx> wrote:
>
> On 6/26/19 7:43 AM, Fabiano Fidêncio wrote:
> > guess_os_from_tree() has been depracated in libosinfo 1.6.0 release and
> > identify_tree() should be used instead.
> >
> > Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
> > ---
> > I'm aware of the "let's not depend on something new for things that are
> > not crucial" policy ... although as I'm already touching this part on
> > libosinfo side, I've decided to do the needed change here as well,
> > otherwise I'd just forget about this. :-)
> >
> > libosinfo patches: https://www.redhat.com/archives/libosinfo/2019-June/msg00113.html
> > ---
> >  virtinst/osdict.py | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/virtinst/osdict.py b/virtinst/osdict.py
> > index 64d8bdb8..01b29cd0 100644
> > --- a/virtinst/osdict.py
> > +++ b/virtinst/osdict.py
> > @@ -260,10 +260,10 @@ class _OSDB(object):
> >                  "location=%s : %s", location, str(e))
> >              return None
> >
> > -        osobj, treeobj = self._os_loader.get_db().guess_os_from_tree(tree)
> > -        if not osobj:
> > -            return None  # pragma: no cover
> > -        return osobj.get_short_id(), treeobj
> > +        if not self._os_loader.get_db().identify_tree(tree):
> > +            return None # prama: no cover
> > +
> > +        return tree.get_os().get_short_id(), tree
> >
> >      def list_os(self):
> >          """
> >
>
> Yeah I can't take this as is. But it's not hard to check for the new API
> and maintain the old code path:
>
> db = self._os_loader.get_db()
> if hasattr(db, "identify_tree"):
>     osobj, treeobj = db.identify_tree(tree)
> else:
>     osobj, treeobj = db.guess_os_from_tree(tree)
> ...
>
> Along with a comment about what version + date libosinfo added that
> function, so it's easier to make a future determination when to remove
> the old code path

Okay, I'll keep this in my TODO list and submit a v2 once libosinfo
1.6.0 is out.

>
> Thanks,
> Cole

Best Regards,
-- 
Fabiano Fidêncio

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux