[ovirt-devel] how to print api method name and params in ovirt

pengyixiang yxpengi386 at 163.com
Tue Sep 5 03:14:02 UTC 2017


hello, everyone!
    We need to customed ovirt, and now I need to know which api been called and transport's params after button been pushed in engine, I try to add logs like this in vdsm:


 455     @api.method
 456     def hotplugDisk(self, params):
 457         syslog.syslog("---in VM hotplugDisk")
 458         syslog.syslog("params:%s" % (params))
 459         try:
 460             utils.validateMinimalKeySet(params, ('vmId', 'drive'))
 461         except ValueError:
 462             self.log.error('Missing one of required parameters: vmId, drive')
 463             return {'status': {'code': errCode['MissParam']['status']['code'],
 464                                'message': 'Missing one of required '
 465                                           'parameters: vmId, drive'}}
 466         return self.vm.hotplugDisk(params)


but the number of api method is too much,  where should I add is better to print called api method name and params?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/devel/attachments/20170905/df0929e8/attachment.html>


More information about the Devel mailing list