[Libosinfo] Getting None back from get_install_script()
Loranz Steve
sloranz at xantham.com
Thu Sep 19 14:25:59 UTC 2013
On Sep 19, 2013, at 2:00 AM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> Hey,
>
> On Wed, Sep 18, 2013 at 04:22:47PM -0500, Loranz Steve wrote:
>> Hello,
>>
>> I might be misreading the code, but my current understanding of the API
>> leads me to believe the following example should behave differently. I'm
>> using the python bindings and going through the following steps to try
>> and get an instance of InstallScript:
>>
>>
>> ---------
>>
>>>>> from gi.repository import Libosinfo as osinfo
>>>>> loader = osinfo.Loader()
>>>>> loader.process_path("/usr/share/libosinfo/db")
>>>>> db = loader.get_db()
>>>>> osid = 'http://microsoft.com/win/2k8r2'
>>>>> osid in db.unique_values_for_property_in_os("id")
>> True
>>>>> print db.get_install_script(osid)
>> None
>>>>> fid = 'http://fedoraproject.org/fedora/18'
>>>>> fid in db.unique_values_for_property_in_os("id")
>> True
>>>>> print db.get_install_script(fid)
>> None
>>
>> ---------
>>
>>
>> Am I using get_install_script() incorrectly?
>
> Most libosinfo objects have an associated id, install scripts are such
> objects. db.get_install_script(osid) will look up an install script whose
> id is osid, but install script ids are not OS ids.
> What you want to do is:
> os = db.get_os(osid)
> install_scripts = os.get_install_script_list()
>
> Hope that helps,
>
> Christophe
It does, thank you.
-steve
More information about the Libosinfo
mailing list