You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the example in the README.md is seems like these get_ functions should return an xml object.
# Retrieve all tasks
tasks = gmp.get_tasks()
# Get names of tasks
task_names = tasks.xpath('task/name/text()')
But now they seem to return an string
Is this an error or by design?
def get_tasks_command(self, kwargs):
"""Generates xml string for get tasks on gvmd."""
cmd = XmlCommand('get_tasks')
cmd.set_attributes(kwargs)
return cmd.to_string()
--
Regards Falk
The text was updated successfully, but these errors were encountered:
First of all GmpCommandFactory is not a public api and will be removed in future. My plan is to remove it before the final python-gvm 1.0 release. And it only creates gmp xml commands as a string.
Second I did change the Gmp class to allow to return any kind of python type from each get/modify/delete/.. method.
Please take a look at the gvm.protocols.gmpv7.Gmp __init__ method for the transform parameter and gvm.transforms for the build in classes for this parameter. Passing a transform allows to change the response.
But you are right. The example in the README.md is currently wrong. By default the Gmp methods are returning a string. A EtreeTransform instance should be passed to Gmp as transform param.
In the example in the README.md is seems like these get_ functions should return an xml object.
But now they seem to return an string
Is this an error or by design?
--
Regards Falk
The text was updated successfully, but these errors were encountered: