arguments issue in indication_tester.py

Hi, There are four parameters in define xml of filter, handler and subscription, but only there are passes to them, that *sysname* is missed. On the former version of libcmpiutil, only three parameters in their define method. So I don't know what's the original idea of it, three or four arguments? Or it's just a minor mistake. Below are some parts of code. ... def filter_xml(name, type, ns, sysname): ... def handler_xml(name, port, sysname): ... def subscription_xml(name, sysname): ... def dump_xml(name, typ, ns): filter_str = filter_xml(name, typ, ns) handler_str = handler_xml(name, 8000) subscript_str = subscription_xml(name) ... Also, I'm not sure of instances deletion order, which including filter, handler and subscription instance. They are created by filter, handler and subscription order, and then deletion order it the same as created in coding. I'm not sure whether the subscription instance have to be deleted firstly. Thanks! Best, Regards Daisy Guo Lian Yun E-mail: yunguol@cn.ibm.com IBM China Development Lab, Shanghai, China TEL: (86)-21-61008057

GY> There are four parameters in define xml of filter, handler and GY> subscription, but only there are passes to them, that *sysname* is GY> missed. The sysname parameter is not missed. It's taken from the URI, which is "localhost:5988" by default. For Pegasus, the URI and the sysname in the XML must be the FQDN of the host system, so you need to specify an appropriate URI with the -u parameter. GY> On the former version of libcmpiutil, only three parameters in GY> their define method. So I don't know what's the original idea of GY> it, three or four arguments? Or it's just a minor mistake. No, it's not a mistake, it's a change required to use the tester against Pegasus :) GY> Below are some parts of code. GY> ... GY> def filter_xml(name, type, ns, sysname): GY> ... GY> def handler_xml(name, port, sysname): GY> ... GY> def subscription_xml(name, sysname): GY> ... GY> def dump_xml(name, typ, ns): GY> filter_str = filter_xml(name, typ, ns) GY> handler_str = handler_xml(name, 8000) GY> subscript_str = subscription_xml(name) GY> ... You should be able to look at the CIMIndicationSubscription, which has "subscribe" and "unsubscribe" methods. Those show the proper way to do the operations. In order to use the code as a module, the CIMIndicationSubscription interface should be all you need and will handle everything for you. GY> Also, I'm not sure of instances deletion order, which including GY> filter, handler and subscription instance. They are created by GY> filter, handler and subscription order, and then deletion order it GY> the same as created in coding. I'm not sure whether the GY> subscription instance have to be deleted firstly. The subscription must be deleted first, followed by the filter and handler (in either order). The code does this correctly. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com
participants (2)
-
Dan Smith
-
Guo Lian Yun