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

[Open-scap] How can i use oval_probe_query_sysinfo in python



Hi,

I want to use python to write a program just like 'oscap oval collect'.But i don't know how to use the function:

int oval_probe_query_sysinfo(oval_probe_session_t *sess, struct oval_sysinfo **out_sysinfo) __attribute__ ((nonnull(1, 2)));

If I use it as:ret,sysinfo = openscap.oval.probe_query_sysinfo(pb_sess, sysinfo)
the error message is:
Traceback (most recent call last):
  File "collect.py", line 34, in <module>
    oval_collect("/usr/share/openscap/scap-fedora14-oval.xml") 
  File "collect.py", line 29, in oval_collect
    ret,sysinfo = openscap.oval.probe_query_sysinfo(pb_sess, sysinfo)
UnboundLocalError: local variable 'sysinfo' referenced before assignment


or:    ret,sysinfo = openscap.oval.probe_query_sysinfo(pb_sess)
the error message is :
Traceback (most recent call last):
  File "collect.py", line 35, in <module>
    oval_collect("/usr/share/openscap/scap-fedora14-oval.xml") 
  File "collect.py", line 30, in oval_collect
    ret,sysinfo = openscap.oval.probe_query_sysinfo(pb_sess)
  File "/usr/lib64/python2.7/site-packages/openscap_api.py", line 181, in __getter_wrapper
    raise TypeError("Wrong number of arguments in function %s" % (func.__name__,))
TypeError: Wrong number of arguments in function oval_probe_query_sysinfo

How can i use this function?

Thanks.

yimao

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