it keeps returning GMPv227’ object has no attribute ‘get_assets’" }
this is my current code:
async def get_all_hosts_with_os(args):
try:
@run_gvm_sync
def sync_get_all_assets(gmp, **kwargs):
assets_list =
assets_xml = gmp.get_assets()
root = etree.fromstring(assets_xml)
for asset in root.findall("asset"):
asset_data = {
"id": asset.get("id"),
"name": asset.findtext("name"),
"ip": asset.findtext("ip"),
"os": asset.findtext("os") or "Unknown",
"severity": asset.findtext("highest_threat") or "0.0",
"first_seen": asset.findtext("first"),
"last_seen": asset.findtext("last"),
}
assets_list.append(asset_data)
return assets_list
# ✅ This passes username/password to the wrapper
result = await asyncio.to_thread(sync_get_all_assets, **vars(args))
return {
"success": True,
"hosts": result,
}
except Exception as e:
return {
"success": False,
"message": str(e),
}
I’ve checked my gvm it’s all up to date