You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(26) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(5) |
Feb
(16) |
Mar
(5) |
Apr
(5) |
May
(13) |
Jun
(12) |
Jul
(1) |
Aug
(2) |
Sep
(13) |
Oct
(6) |
Nov
(1) |
Dec
(29) |
2008 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
(57) |
May
(35) |
Jun
(45) |
Jul
(132) |
Aug
(87) |
Sep
(141) |
Oct
(86) |
Nov
(17) |
Dec
(2) |
2009 |
Jan
(3) |
Feb
(2) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <mik...@us...> - 2008-09-11 22:16:37
|
Revision: 957 http://omc.svn.sourceforge.net/omc/?rev=957&view=rev Author: mike-brasher Date: 2008-09-11 22:16:48 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Implemented BrokerCIMOMHandle.Associators() and AssociatosNames(). Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cmpi_bindings.py Modified: cmpi-bindings/trunk/swig/python/cmpi_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-11 19:34:18 UTC (rev 956) +++ cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-11 22:16:48 UTC (rev 957) @@ -71,7 +71,6 @@ raise StopIteration return cmpi2pywbem_inst(val) - class BrokerCIMOMHandle(object): def __init__(self, broker, ctx): self.broker = broker @@ -94,10 +93,20 @@ return None return cmpi2pywbem_inst(ci) - def Associators(self): - pass - def AssociatorNames(self): - pass + def Associators(self, path, assocClass = None, resultClass = None, + role = None, resultRole = None, props = None): + cop = pywbem2cmpi_instname(path) + e = self.broker.associators(self.ctx, cop, assocClass, resultClass, + role, resultRole, props) + return CIMInstanceIterator(e) + + def AssociatorNames(self, path, assocClass = None, resultClass = None, + role = None, resultRole = None, props = None): + cop = pywbem2cmpi_instname(path) + e = self.broker.associatorNames(self.ctx, cop, assocClass, resultClass, + role, resultRole) + return CIMInstanceNameIterator(e) + def References(self): pass def ReferenceNames(self): @@ -156,7 +165,6 @@ def __init__(self, miname, broker): print 'called CMPIProvider(', miname, ',', broker, ')' - broker = cmpi.CMPIBroker() self.broker = broker self.miname = miname self.env = ProviderEnvironment(self.broker) @@ -331,18 +339,18 @@ def authorize_filter(self, ctx, filter, className, classPath, owner): - self.env.ctx = ctx + #self.env.ctx = ctx pass def activate_filter(self, ctx, filter, className, classPath, firstActivation): - self.env.ctx = ctx + #self.env.ctx = ctx pass def deactivate_filter(self, ctx, filter, className, classPath, lastActivation): - self.env.ctx = ctx + #self.env.ctx = ctx pass @@ -350,16 +358,16 @@ #def must_poll(self, ctx, rslt, filter, className, classPath): # NOTE: sfcb signature for this doesn't have the rslt. def must_poll(self, ctx, filter, className, classPath): - self.env.ctx = ctx + #self.env.ctx = ctx pass def enable_indications(self, ctx): - self.env.ctx = ctx + #self.env.ctx = ctx pass def disable_indications(self, ctx): - self.env.ctx = ctx + #self.env.ctx = ctx pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-11 19:34:07
|
Revision: 956 http://omc.svn.sourceforge.net/omc/?rev=956&view=rev Author: bartw Date: 2008-09-11 19:34:18 +0000 (Thu, 11 Sep 2008) Log Message: ----------- removed unneeded parameter from references Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cim_provider.py cmpi-bindings/trunk/test/python/TestAssocProvider.py Modified: cmpi-bindings/trunk/swig/python/cim_provider.py =================================================================== --- cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-11 19:20:06 UTC (rev 955) +++ cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-11 19:34:18 UTC (rev 956) @@ -375,7 +375,7 @@ """ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED, "") - def references(self, env, object_name, model, assoc_class_name, + def references(self, env, object_name, model, result_class_name, role, result_role, keys_only): """Instrument Associations. @@ -390,7 +390,6 @@ model -- A template pywbem.CIMInstance to serve as a model of the objects to be returned. Only properties present on this model need to be set. - assoc_class_name -- The name of the association class. result_class_name -- If not empty, this string acts as a filter on the returned set of Instances by mandating that each returned Instances MUST represent an association between object_name @@ -657,7 +656,6 @@ for inst in self.references(env=env, object_name=objectName, model=model, - assoc_class_name=assocClassName, result_class_name=resultClassName, role=role, result_role=None, @@ -715,7 +713,6 @@ for inst in self.references(env=env, object_name=objectName, model=model, - assoc_class_name=assocClassName, result_class_name=resultClassName, role=role, result_role=None, @@ -772,7 +769,6 @@ for inst in self.references(env=env, object_name=objectName, model=model, - assoc_class_name=resultClassName, result_class_name='', role=role, result_role=None, @@ -817,7 +813,6 @@ for inst in self.references(env=env, object_name=objectName, model=model, - assoc_class_name=resultClassName, result_class_name='', role=role, result_role=None, Modified: cmpi-bindings/trunk/test/python/TestAssocProvider.py =================================================================== --- cmpi-bindings/trunk/test/python/TestAssocProvider.py 2008-09-11 19:20:06 UTC (rev 955) +++ cmpi-bindings/trunk/test/python/TestAssocProvider.py 2008-09-11 19:34:18 UTC (rev 956) @@ -162,7 +162,7 @@ def delete_instance(self, env, instance_name): raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) - def references(self, env, object_name, model, assoc_class_name, + def references(self, env, object_name, model, result_class_name, role, result_role, keys_only): self._logger.log_debug("\n%s: References called for class %s" % (self.__class__.__name__.upper(), object_name)) model.path.keybindings['antecedent'] = None This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-11 19:19:58
|
Revision: 955 http://omc.svn.sourceforge.net/omc/?rev=955&view=rev Author: bartw Date: 2008-09-11 19:20:06 +0000 (Thu, 11 Sep 2008) Log Message: ----------- more work on embedded instances Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cmpi_bindings.py Modified: cmpi-bindings/trunk/swig/python/cmpi_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-11 18:20:57 UTC (rev 954) +++ cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-11 19:20:06 UTC (rev 955) @@ -397,7 +397,10 @@ def pywbem2cmpi_inst(pinst): - cop = pywbem2cmpi_instname(pinst.path) + pcop = pinst.path + if pcop is None: + pcop = pywbem.CIMInstanceName(pinst.classname) + cop = pywbem2cmpi_instname(pcop) cinst = cmpi.CMPIInstance(cop) for prop in pinst.properties.values(): data, _type = pywbem2cmpi_value(prop.value, _type=prop.type) @@ -433,7 +436,9 @@ return None, _type is_array = isinstance(pdata, list) if _type is None: - if isinstance(pdata, pywbem.CIMInstanceName): + if isinstance(pdata, pywbem.CIMInstance): + _type = 'instance' + elif isinstance(pdata, pywbem.CIMInstanceName): _type = 'reference' else: _type = pywbem.cimtype(pdata) @@ -457,6 +462,9 @@ elif _type == 'datetime': attr = 'dateTime' pdata = pywbem2cmpi_datetime(pdata) + elif _type == 'instance': + attr = 'inst' + pdata = pywbem2cmpi_inst(pdata) setattr(cval, attr, pdata) return cval, _type @@ -561,6 +569,7 @@ 'reference' : cmpi.CMPI_ref, 'string' : cmpi.CMPI_string, 'datetime' : cmpi.CMPI_dateTime, + 'instance' : cmpi.CMPI_instance, } _cmpi2pywbem_typemap = { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mik...@us...> - 2008-09-11 18:20:47
|
Revision: 954 http://omc.svn.sourceforge.net/omc/?rev=954&view=rev Author: mike-brasher Date: 2008-09-11 18:20:57 +0000 (Thu, 11 Sep 2008) Log Message: ----------- Fix for illegal "#ifdef (X)" syntax. Modified Paths: -------------- cmpi-bindings/trunk/swig/cmpi_defs.i Modified: cmpi-bindings/trunk/swig/cmpi_defs.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi_defs.i 2008-09-11 17:06:47 UTC (rev 953) +++ cmpi-bindings/trunk/swig/cmpi_defs.i 2008-09-11 18:20:57 UTC (rev 954) @@ -18,7 +18,7 @@ #----------------------------------------------------- -#ifdef (SWIGPYTHON) +#if defined(SWIGPYTHON) # # Conversion from list of python strings to null terminated char** array. # @@ -67,7 +67,7 @@ if ($1) free($1); } -#endif /* SWIGPYTHON */ +#endif /* defined(SWIGPYTHON) */ #----------------------------------------------------- # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-11 17:06:39
|
Revision: 953 http://omc.svn.sourceforge.net/omc/?rev=953&view=rev Author: bartw Date: 2008-09-11 17:06:47 +0000 (Thu, 11 Sep 2008) Log Message: ----------- fixed provider registration in codegen Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cim_provider.py Modified: cmpi-bindings/trunk/swig/python/cim_provider.py =================================================================== --- cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-11 17:05:42 UTC (rev 952) +++ cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-11 17:06:47 UTC (rev 953) @@ -1469,24 +1469,24 @@ // Pegasus Provider registration for %(classname)s instance of PG_ProviderModule { - Name = "/usr/lib/pycim/%(classname)sProvider.py"; - InterfaceType = "Python"; - InterfaceVersion = "1.0.0"; - Location = "/usr/lib/pycim/%(classname)sProvider.py"; + Name = "pyCmpiProvider_%(classname)s"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; + Location = "pyCmpiProvider"; UserContext = 2; // Requestor Vendor = "TODO"; // TODO Version = "1.0"; }; instance of PG_Provider { - Name = "%(classname)s"; - ProviderModuleName = "/usr/lib/pycim/%(classname)sProvider.py"; + Name = "%(classname)sProvider"; + ProviderModuleName = "pyCmpiProvider_%(classname)s"; }; instance of PG_ProviderCapabilities { CapabilityID = "%(classname)s"; - ProviderModuleName = "/usr/lib/pycim/%(classname)sProvider.py"; - ProviderName = "%(classname)s"; + ProviderModuleName = "pyCmpiProvider_%(classname)s"; + ProviderName = "%(classname)sProvider"; ClassName = "%(classname)s"; Namespaces = {"root/cimv2"}; // TODO ProviderType = {%(pegtypeNum)s}; // %(pegtypeStr)s This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-11 17:05:33
|
Revision: 952 http://omc.svn.sourceforge.net/omc/?rev=952&view=rev Author: bartw Date: 2008-09-11 17:05:42 +0000 (Thu, 11 Sep 2008) Log Message: ----------- fixes for embedded instances Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cmpi_bindings.py cmpi-bindings/trunk/test/python/TestMethod.py cmpi-bindings/trunk/test/python/TestMethod_Test.py Modified: cmpi-bindings/trunk/swig/python/cmpi_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-11 15:10:30 UTC (rev 951) +++ cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-11 17:05:42 UTC (rev 952) @@ -522,6 +522,8 @@ attr = 'dateTime' if attr == 'reference': attr = 'ref' + if attr == 'instance': + attr = 'inst' val = getattr(cdata.value, attr) if val is None: return None @@ -533,6 +535,9 @@ val = cmpi2pywbem_datetime(val) if _type == 'reference': val = cmpi2pywbem_instname(val) + if _type == 'instance': + val = cmpi2pywbem_inst(val) + return val return pywbem.tocimobj(_type, val) def cmpi2pywbem_datetime(dt): @@ -574,10 +579,10 @@ cmpi.CMPI_ref : 'reference', cmpi.CMPI_string : 'string', cmpi.CMPI_dateTime : 'datetime', + cmpi.CMPI_instance : 'instance', #cmpi.CMPI_null : None, #cmpi.CMPI_args : 'args', - #cmpi.CMPI_instance : 'instance', #cmpi.CMPI_class : 'class ', #cmpi.CMPI_filter : 'filter', #cmpi.CMPI_ptr : 'ptr', Modified: cmpi-bindings/trunk/test/python/TestMethod.py =================================================================== --- cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-11 15:10:30 UTC (rev 951) +++ cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-11 17:05:42 UTC (rev 952) @@ -696,26 +696,27 @@ rval = pywbem.Sint32(0) return (rval, out_params) - def cim_method_createobject(self, env, object_name,inst): + def cim_method_createobject(self, env, object_name, param_inst): logger = env.get_logger() logger.log_debug('Entering %s.cim_method_createobject()' \ % self.__class__.__name__) - g_insts[inst['id']] = [inst['p_str'], inst['p_sint32']] + g_insts[param_inst['id']] = [param_inst['p_str'], + param_inst['p_sint32']] - out_params = {} + out_params = [] rval = pywbem.Sint32(0) return (rval, out_params) - def cim_method_createobjects(self, env, object_name,insts): + def cim_method_createobjects(self, env, object_name, param_insts): logger = env.get_logger() logger.log_debug('Entering %s.cim_method_createobject()' \ % self.__class__.__name__) - for inst in insts: + for inst in param_insts: g_insts[inst['id']] = [inst['p_str'], inst['p_sint32']] - out_params = {} + out_params = [] rval = pywbem.Sint32(0) return (rval, out_params) Modified: cmpi-bindings/trunk/test/python/TestMethod_Test.py =================================================================== --- cmpi-bindings/trunk/test/python/TestMethod_Test.py 2008-09-11 15:10:30 UTC (rev 951) +++ cmpi-bindings/trunk/test/python/TestMethod_Test.py 2008-09-11 17:05:42 UTC (rev 952) @@ -490,25 +490,36 @@ self.assertEquals(outs['med'], 5) - def xtest_xembeddedinst(self): + def test_xembeddedinst(self): iname = pywbem.CIMInstanceName('Test_Method', namespace='root/cimv2', keybindings = {'id':'one'}) inst = pywbem.CIMInstance('Test_Method', path=None, properties={'p_str':'str1', 'p_sint32':pywbem.Sint32(1)}) - self.conn.debug = True - try: - rv, outs = self.conn.InvokeMethod('createObject', 'Test_Method', + inst.update(iname) + rv, outs = self.conn.InvokeMethod('createObject', 'Test_Method', inst=inst) - except: - print self.conn.last_request - print self.conn.last_reply - raise insts = self.conn.EnumerateInstances('Test_Method') self.assertEquals(len(insts), 1) - ninsts = self.conn.GetInstance(iname) - self.assertEquals(ninsts[0]['p_str'], 'str1') - self.assertEquals(ninsts[0]['p_sint32'], 1) + ninst = self.conn.GetInstance(iname) + self.assertEquals(ninst['p_str'], 'str1') + self.assertEquals(ninst['p_sint32'], 1) + iname2 = pywbem.CIMInstanceName('Test_Method', namespace='root/cimv2', + keybindings = {'id':'two'}) + inst2 = pywbem.CIMInstance('Test_Method', path=None, + properties={'p_str':'str2', 'p_sint32':pywbem.Sint32(2)}) + inst2.update(iname2) + + self.conn.DeleteInstance(iname) + rv, outs = self.conn.InvokeMethod('createObjects', 'Test_Method', + insts=[inst, inst2]) + insts = self.conn.EnumerateInstances('Test_Method') + self.assertEquals(len(insts), 2) + ninst = self.conn.GetInstance(iname2) + self.assertEquals(ninst['p_str'], 'str2') + self.assertEquals(ninst['p_sint32'], 2) + + def get_unit_test(): return TestMethods This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <np...@us...> - 2008-09-11 15:10:19
|
Revision: 951 http://omc.svn.sourceforge.net/omc/?rev=951&view=rev Author: npaxton Date: 2008-09-11 15:10:30 +0000 (Thu, 11 Sep 2008) Log Message: ----------- wrap CMClassPathIsA into is_subclass on BrokerCIMOMHandle Modified Paths: -------------- cmpi-bindings/trunk/TODO cmpi-bindings/trunk/swig/cmpi_callbacks.i cmpi-bindings/trunk/swig/python/cmpi_bindings.py Modified: cmpi-bindings/trunk/TODO =================================================================== --- cmpi-bindings/trunk/TODO 2008-09-11 13:37:51 UTC (rev 950) +++ cmpi-bindings/trunk/TODO 2008-09-11 15:10:30 UTC (rev 951) @@ -19,6 +19,3 @@ Wrap CMPIEnumeration and CMPIArray in typemaps. -Wrap CMPIBrokerEncFT.classPathIsA() - - Modified: cmpi-bindings/trunk/swig/cmpi_callbacks.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-11 13:37:51 UTC (rev 950) +++ cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-11 15:10:30 UTC (rev 951) @@ -22,6 +22,9 @@ const char *name() { return CBBrokerName($self); } + CMPIBoolean classPathIsA(const CMPIObjectPath *op, const char *parent_class) { + return CMClassPathIsA($self, op, parent_class, NULL); + } CMPIStatus deliverIndication(const CMPIContext * ctx, const char * ns, const CMPIInstance * ind) { return CBDeliverIndication($self, ctx, ns, ind); } Modified: cmpi-bindings/trunk/swig/python/cmpi_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-11 13:37:51 UTC (rev 950) +++ cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-11 15:10:30 UTC (rev 951) @@ -110,6 +110,12 @@ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) def EnumerateClasses(self, *args, **kwargs): raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) + ### Not sure whether this should be on BrokerCIMOMHandle or + ### on ProviderEnvironment + ### We may want to move it ? + def is_subclass(self, ns, super, sub): + subObjPath=cmpi.CMPIObjectPath(ns, sub) + return bool(self.broker.classPathIsA(subObjPath,super)) class Logger(object): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2008-09-11 13:37:42
|
Revision: 950 http://omc.svn.sourceforge.net/omc/?rev=950&view=rev Author: kkaempf Date: 2008-09-11 13:37:51 +0000 (Thu, 11 Sep 2008) Log Message: ----------- limit the char** typemap to Python Modified Paths: -------------- cmpi-bindings/trunk/swig/cmpi_defs.i Modified: cmpi-bindings/trunk/swig/cmpi_defs.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi_defs.i 2008-09-11 13:32:40 UTC (rev 949) +++ cmpi-bindings/trunk/swig/cmpi_defs.i 2008-09-11 13:37:51 UTC (rev 950) @@ -17,6 +17,8 @@ %include "cmpidt.h" #----------------------------------------------------- + +#ifdef (SWIGPYTHON) # # Conversion from list of python strings to null terminated char** array. # @@ -65,6 +67,7 @@ if ($1) free($1); } +#endif /* SWIGPYTHON */ #----------------------------------------------------- # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2008-09-11 13:32:29
|
Revision: 949 http://omc.svn.sourceforge.net/omc/?rev=949&view=rev Author: kkaempf Date: 2008-09-11 13:32:40 +0000 (Thu, 11 Sep 2008) Log Message: ----------- bump version to 0.2.0 Modified Paths: -------------- cmpi-bindings/trunk/VERSION.cmake cmpi-bindings/trunk/package/cmpi-bindings.changes cmpi-bindings/trunk/package/cmpi-bindings.spec.in Modified: cmpi-bindings/trunk/VERSION.cmake =================================================================== --- cmpi-bindings/trunk/VERSION.cmake 2008-09-11 09:38:29 UTC (rev 948) +++ cmpi-bindings/trunk/VERSION.cmake 2008-09-11 13:32:40 UTC (rev 949) @@ -1,3 +1,3 @@ SET(VERSION_MAJOR "0") -SET(VERSION_MINOR "1") +SET(VERSION_MINOR "2") SET(VERSION_PATCH "0") Modified: cmpi-bindings/trunk/package/cmpi-bindings.changes =================================================================== --- cmpi-bindings/trunk/package/cmpi-bindings.changes 2008-09-11 09:38:29 UTC (rev 948) +++ cmpi-bindings/trunk/package/cmpi-bindings.changes 2008-09-11 13:32:40 UTC (rev 949) @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Sep 11 15:29:08 CEST 2008 - kk...@su... + +- Support Python threads, do proper locking +- Bump version to 0.2.0 + +------------------------------------------------------------------- Tue Sep 2 11:10:23 CEST 2008 - kk...@su... - Initial package. Modified: cmpi-bindings/trunk/package/cmpi-bindings.spec.in =================================================================== --- cmpi-bindings/trunk/package/cmpi-bindings.spec.in 2008-09-11 09:38:29 UTC (rev 948) +++ cmpi-bindings/trunk/package/cmpi-bindings.spec.in 2008-09-11 13:32:40 UTC (rev 949) @@ -70,7 +70,8 @@ %files -n cmpi-bindings-pywbem %defattr(-,root,root,-) %{_libdir}/cmpi/libpyCmpiProvider.so -%{py_sitedir}/pycmpi_provider.py +%{py_sitedir}/cmpi_bindings.py +%{py_sitedir}/cim_provider.py %{py_sitedir}/cmpi.py %changelog This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2008-09-11 09:38:25
|
Revision: 948 http://omc.svn.sourceforge.net/omc/?rev=948&view=rev Author: kkaempf Date: 2008-09-11 09:38:29 +0000 (Thu, 11 Sep 2008) Log Message: ----------- dont ignore 'package/' subdir Modified Paths: -------------- cmpi-bindings/trunk/CMakeLists.txt Modified: cmpi-bindings/trunk/CMakeLists.txt =================================================================== --- cmpi-bindings/trunk/CMakeLists.txt 2008-09-11 09:37:45 UTC (rev 947) +++ cmpi-bindings/trunk/CMakeLists.txt 2008-09-11 09:38:29 UTC (rev 948) @@ -39,10 +39,16 @@ SET( PACKAGE "cmpi-bindings" ) SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" ) + +#################################################################### +# CPACK # +#################################################################### + + SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Language Bindings for CMPI") SET(CPACK_PACKAGE_VENDOR "Novell Inc.") -#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt") -#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") +SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/doc/README") +SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.BSD") SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) @@ -58,12 +64,15 @@ "/CVS/;/.svn/;/.libs/;/.deps/;.swp$;.#;/#;/build/" "~$" "\\\\.cvsignore$" -"/package" "Makefile\\\\.in$" ) INCLUDE(CPack) +#################################################################### +# Find SWIG # +#################################################################### + #FIND_PACKAGE(SWIG REQUIRED) MESSAGE(STATUS "Looking modules in ${CMAKE_MODULE_PATH}") FIND_PROGRAM(SWIG_EXECUTABLE @@ -77,6 +86,11 @@ MESSAGE( STATUS "SWIG found at ${SWIG_EXECUTABLE}" ) ENDIF ( NOT SWIG_EXECUTABLE ) + +#################################################################### +# Directories # +#################################################################### + # don't build standalone provider, its included in the swig code #ADD_SUBDIRECTORY(src) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2008-09-11 09:37:35
|
Revision: 947 http://omc.svn.sourceforge.net/omc/?rev=947&view=rev Author: kkaempf Date: 2008-09-11 09:37:45 +0000 (Thu, 11 Sep 2008) Log Message: ----------- abort on Python import failure Modified Paths: -------------- cmpi-bindings/trunk/src/cmpi_provider_python.c Modified: cmpi-bindings/trunk/src/cmpi_provider_python.c =================================================================== --- cmpi-bindings/trunk/src/cmpi_provider_python.c 2008-09-11 03:17:09 UTC (rev 946) +++ cmpi-bindings/trunk/src/cmpi_provider_python.c 2008-09-11 09:37:45 UTC (rev 947) @@ -235,8 +235,9 @@ if (_PYPROVMOD == NULL) { SWIG_PYTHON_THREAD_END_BLOCK; - _SBLIM_TRACE(1,("<%d/0x%x> Python: _PYPROVMOD at %p", getpid(), pthread_self(), _PYPROVMOD)); + _SBLIM_TRACE(1,("<%d/0x%x> Python: import cmpi_bindings failed", getpid(), pthread_self())); PY_CMPI_SETFAIL(get_exc_trace()); + abort(); return -1; } _SBLIM_TRACE(1,("<%d/0x%x> Python: _PYPROVMOD at %p", getpid(), pthread_self(), _PYPROVMOD)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-11 03:16:58
|
Revision: 946 http://omc.svn.sourceforge.net/omc/?rev=946&view=rev Author: bartw Date: 2008-09-11 03:17:09 +0000 (Thu, 11 Sep 2008) Log Message: ----------- updated pegasus registration files Modified Paths: -------------- cmpi-bindings/trunk/test/python/TestAssocProvider-peg.reg cmpi-bindings/trunk/test/python/TestAtomProvider.peg.reg cmpi-bindings/trunk/test/python/TestMethod.peg.reg Modified: cmpi-bindings/trunk/test/python/TestAssocProvider-peg.reg =================================================================== --- cmpi-bindings/trunk/test/python/TestAssocProvider-peg.reg 2008-09-11 03:04:01 UTC (rev 945) +++ cmpi-bindings/trunk/test/python/TestAssocProvider-peg.reg 2008-09-11 03:17:09 UTC (rev 946) @@ -2,16 +2,16 @@ instance of PG_ProviderModule { Name = "TestAssocProvider-Module"; - InterfaceType = "Python"; - InterfaceVersion = "1.0.0"; - Location = "/usr/lib/pycim/TestAssocProvider.py"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; + Location = "pyCmpiProvider"; Vendor = "Novell"; Version = "1.0.0"; }; instance of PG_Provider { - Name = "TestAssocProvider-Provider"; + Name = "TestAssocProvider"; ProviderModuleName = "TestAssocProvider-Module"; }; @@ -19,7 +19,7 @@ { CapabilityID = "TestAssocProvider-Capability1"; ProviderModuleName = "TestAssocProvider-Module"; - ProviderName = "TestAssocProvider-Provider"; + ProviderName = "TestAssocProvider"; ClassName = "TestAssoc_User"; Namespaces = {"root/cimv2"}; ProviderType = {2}; // Instance @@ -29,7 +29,7 @@ { CapabilityID = "TestAssocProvider-Capability2"; ProviderModuleName = "TestAssocProvider-Module"; - ProviderName = "TestAssocProvider-Provider"; + ProviderName = "TestAssocProvider"; ClassName = "TestAssoc_Group"; Namespaces = {"root/cimv2"}; ProviderType = {2}; // Instance @@ -39,7 +39,7 @@ { CapabilityID = "TestAssocProvider-Capability3"; ProviderModuleName = "TestAssocProvider-Module"; - ProviderName = "TestAssocProvider-Provider"; + ProviderName = "TestAssocProvider"; ClassName = "TestAssoc_MemberOfGroup"; Namespaces = {"root/cimv2"}; ProviderType = {2,3}; // Instance/Association Modified: cmpi-bindings/trunk/test/python/TestAtomProvider.peg.reg =================================================================== --- cmpi-bindings/trunk/test/python/TestAtomProvider.peg.reg 2008-09-11 03:04:01 UTC (rev 945) +++ cmpi-bindings/trunk/test/python/TestAtomProvider.peg.reg 2008-09-11 03:17:09 UTC (rev 946) @@ -2,23 +2,23 @@ instance of PG_ProviderModule { Name = "TestAtom_Module"; - Location = "TestAtomProvider"; + Location = "pyCmpiProvider"; Vendor = "Novell"; Version = "1.0.0"; - InterfaceType = "Python"; - InterfaceVersion = "1.0.0"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; }; instance of PG_Provider { - Name = "TestAtom_Provider"; + Name = "TestAtomProvider"; ProviderModuleName = "TestAtom_Module"; }; instance of PG_ProviderCapabilities { ProviderModuleName = "TestAtom_Module"; - ProviderName = "TestAtom_Provider"; + ProviderName = "TestAtomProvider"; ClassName = "Test_Atom"; ProviderType = { 2 }; Namespaces = {"root/cimv2"}; Modified: cmpi-bindings/trunk/test/python/TestMethod.peg.reg =================================================================== --- cmpi-bindings/trunk/test/python/TestMethod.peg.reg 2008-09-11 03:04:01 UTC (rev 945) +++ cmpi-bindings/trunk/test/python/TestMethod.peg.reg 2008-09-11 03:17:09 UTC (rev 946) @@ -1,10 +1,10 @@ //////// TestMethod instance of PG_ProviderModule { - Name = "/usr/lib/pycim/TestMethod.py"; - InterfaceType = "Python"; - InterfaceVersion = "1.0.0"; - Location = "/usr/lib/pycim/TestMethod.py"; + Name = "TestMethod-Module"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; + Location = "pyCmpiProvider"; Vendor = "OMC"; Version = "0.1.0"; }; @@ -12,13 +12,13 @@ instance of PG_Provider { Name = "TestMethod"; - ProviderModuleName = "/usr/lib/pycim/TestMethod.py"; + ProviderModuleName = "TestMethod-Module"; }; instance of PG_ProviderCapabilities { CapabilityID = "TestMethod"; - ProviderModuleName = "/usr/lib/pycim/TestMethod.py"; + ProviderModuleName = "TestMethod-Module"; ProviderName = "TestMethod"; ClassName = "Test_Method"; Namespaces = {"root/cimv2"}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-11 03:03:52
|
Revision: 945 http://omc.svn.sourceforge.net/omc/?rev=945&view=rev Author: bartw Date: 2008-09-11 03:04:01 +0000 (Thu, 11 Sep 2008) Log Message: ----------- fixed a couple of typos. Now cmpi-bindings works under Pegasus as well as SFCB Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cmpi_bindings.py Modified: cmpi-bindings/trunk/swig/python/cmpi_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-11 01:27:12 UTC (rev 944) +++ cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-11 03:04:01 UTC (rev 945) @@ -215,7 +215,7 @@ return args[:2] ciname = pywbem2cmpi_instname(piname) rslt.return_objectpath(ciname) - rslt.done + rslt.done() return (0, '') @@ -320,7 +320,7 @@ data, _type = pywbem2cmpi_value(rv, _type=_type) rslt.return_data(data, _pywbem2cmpi_typemap[_type]) - rslt.done + rslt.done() return (0, '') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-11 01:27:02
|
Revision: 944 http://omc.svn.sourceforge.net/omc/?rev=944&view=rev Author: bartw Date: 2008-09-11 01:27:12 +0000 (Thu, 11 Sep 2008) Log Message: ----------- updated codegen to use new is_subclass Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cim_provider.py Modified: cmpi-bindings/trunk/swig/python/cim_provider.py =================================================================== --- cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-11 01:00:19 UTC (rev 943) +++ cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-11 01:27:12 UTC (rev 944) @@ -1388,7 +1388,9 @@ for refprop in refprops: code+= ''' if (not role or role.lower() == '%(refpropnamel)s') and \\ - object_name.classname.lower() == '%(rolecnamel)s': + ch.is_subclass(object_name.namespace, + sub=object_name.classname, + super='%(rolecname)s'): model['%(refpropname)s'] = object_name yield model # TODO: Add other REF properties. # Yield association instances where @@ -1397,8 +1399,7 @@ # is '%(rolecname)s' or a subclass.\n''' \ % {'refpropname':refprop[0], 'refpropnamel':refprop[0].lower(), - 'rolecname':refprop[1], - 'rolecnamel':refprop[1].lower()} + 'rolecname':refprop[1]} if valuemaps: code+= ''' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-11 01:00:08
|
Revision: 943 http://omc.svn.sourceforge.net/omc/?rev=943&view=rev Author: bartw Date: 2008-09-11 01:00:19 +0000 (Thu, 11 Sep 2008) Log Message: ----------- change associators to use new GetInstance broker up-call. remove some old commented-out code. Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cim_provider.py Modified: cmpi-bindings/trunk/swig/python/cim_provider.py =================================================================== --- cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-10 23:37:05 UTC (rev 942) +++ cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-11 01:00:19 UTC (rev 943) @@ -471,15 +471,6 @@ logger = env.get_logger() logger.log_debug('CIMProvider MI_enumInstanceNames called...') - ''' - keys = pywbem.NocaseDict() - [keys.__setitem__(p.name, p) for p in cimClass.properties.values()\ - if 'key' in p.qualifiers] - - _strip_quals(keys) - path = pywbem.CIMInstanceName(classname=cimClass.classname, - namespace=ns) - ''' model = pywbem.CIMInstance(classname=objPath.classname, path=objPath) gen = self.enum_instances(env=env, @@ -510,20 +501,7 @@ """ logger = env.get_logger() logger.log_debug('CIMProvider MI_enumInstances called...') - ''' - keyNames = get_keys_from_class(cimClass) - plist = None - if propertyList is not None: - lkns = [kn.lower() for kn in keyNames] - props = pywbem.NocaseDict() - plist = [s.lower() for s in propertyList] - pklist = plist + lkns - [props.__setitem__(p.name, p) for p in cimClass.properties.values() - if p.name.lower() in pklist] - else: - props = cimClass.properties - _strip_quals(props) - ''' + model = pywbem.CIMInstance(classname=objPath.classname, path=objPath) gen = self.enum_instances(env=env, @@ -672,16 +650,7 @@ if not assocClassName: raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, "Empty assocClassName passed to Associators") - ''' - assocClass = ch.GetClass(assocClassName, objectName.namespace, - LocalOnly=False, - IncludeQualifiers=True) - plist = pywbem.NocaseDict() - [plist.__setitem__(p.name, p) for p in assocClass.properties.values() - if 'key' in p.qualifiers or p.type == 'reference'] - _strip_quals(plist) - ''' - ch = env.get_cimom_handle() + ch = env.get_cimom_handle2() model = pywbem.CIMInstance(classname=assocClassName) model.path = pywbem.CIMInstanceName(classname=assocClassName, namespace=objectName.namespace) @@ -709,11 +678,7 @@ try: if prop.value.namespace is None: prop.value.namespace = objectName.namespace - args = {'IncludeQualifiers':True, - 'IncludeClassOrigin':True} - if propertyList is not None: - args['PropertyList'] = propertyList - inst = ch.GetInstance(prop.value, **args) + inst = ch.GetInstance(prop.value, propertyList) except pywbem.CIMError, (num, msg): if num == pywbem.CIM_ERR_NOT_FOUND: continue @@ -798,9 +763,6 @@ model = pywbem.CIMInstance(classname=resultClassName) model.path = pywbem.CIMInstanceName(classname=resultClassName, namespace=objectName.namespace) - #if role is None: - # raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, - # "** this shouldn't happen") if role: if role not in model.properties: raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, @@ -847,9 +809,6 @@ model = pywbem.CIMInstance(classname=resultClassName) model.path = pywbem.CIMInstanceName(classname=resultClassName, namespace=objectName.namespace) - #if role is None: - # raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, - # "** this shouldn't happen") if role: if role not in model.properties: raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mik...@us...> - 2008-09-10 23:36:55
|
Revision: 942 http://omc.svn.sourceforge.net/omc/?rev=942&view=rev Author: mike-brasher Date: 2008-09-10 23:37:05 +0000 (Wed, 10 Sep 2008) Log Message: ----------- Implemented: BrokerCIMOMHandle.GetInstance() BrokerCIMOMHandle.EnumerateInstances() BrokerCIMOMHandle.EnumerateInstanceNames() Modified Paths: -------------- cmpi-bindings/trunk/register.sh cmpi-bindings/trunk/swig/cmpi_defs.i cmpi-bindings/trunk/swig/python/cmpi_bindings.py cmpi-bindings/trunk/test/python/TestMethod.py Modified: cmpi-bindings/trunk/register.sh =================================================================== --- cmpi-bindings/trunk/register.sh 2008-09-10 23:04:23 UTC (rev 941) +++ cmpi-bindings/trunk/register.sh 2008-09-10 23:37:05 UTC (rev 942) @@ -1,5 +1,5 @@ #!/bin/sh -cp ./build/swig/python/cmpi.py ./swig/python/pycmpi_provider.py /usr/lib64/python2.5/site-packages +cp ./build/swig/python/cmpi.py ./swig/python/cim_provider.py ./swig/python/cmpi_bindings.py /usr/lib64/python2.5/site-packages cp ./mof/Py_UnixProcess.reg /var/lib/sfcb/stage/regs cp ./mof/Py_UnixProcess.mof /var/lib/sfcb/stage/mofs/root/cimv2 cp ./build/swig/python/libpyCmpiProvider.so /usr/lib64/ Modified: cmpi-bindings/trunk/swig/cmpi_defs.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi_defs.i 2008-09-10 23:04:23 UTC (rev 941) +++ cmpi-bindings/trunk/swig/cmpi_defs.i 2008-09-10 23:37:05 UTC (rev 942) @@ -16,7 +16,56 @@ %include "cmpidt.h" +#----------------------------------------------------- +# +# Conversion from list of python strings to null terminated char** array. +# +%typemap(in) char ** +{ + int size; + int i; + + if ($input == Py_None) + { + $1 = NULL; + } + else + { + if (!PyList_Check($input)) + { + PyErr_SetString(PyExc_TypeError, "expected list argument"); + return NULL; + } + + size = PyList_Size($input); + + $1 = (char**)malloc(size + 1); + + for (i = 0; i < size; i++) + { + PyObject* obj = PyList_GetItem($input, i); + + if (PyString_Check(obj)) + $1[i] = PyString_AsString(PyList_GetItem($input,i)); + else + { + PyErr_SetString(PyExc_TypeError,"list contains non-string"); + free($1); + return NULL; + } + } + + $1[i] = 0; + } +} + +%typemap(freearg) char ** +{ + if ($1) + free($1); +} + #----------------------------------------------------- # # CMPIData Modified: cmpi-bindings/trunk/swig/python/cmpi_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-10 23:04:23 UTC (rev 941) +++ cmpi-bindings/trunk/swig/python/cmpi_bindings.py 2008-09-10 23:37:05 UTC (rev 942) @@ -41,16 +41,59 @@ def SFCBUDSConnection(): return pywbem.WBEMConnection('/tmp/sfcbHttpSocket') +class CIMInstanceNameIterator: + def __init__(self, enumeration): + self.enumeration = enumeration + + def __iter__(self): + return self + + def next(self): + if not self.enumeration.hasNext(): + raise StopIteration + val = getattr(self.enumeration.next().value, 'ref') + if val is None: + raise StopIteration + return cmpi2pywbem_instname(val) + +class CIMInstanceIterator: + def __init__(self, enumeration): + self.enumeration = enumeration + + def __iter__(self): + return self + + def next(self): + if not self.enumeration.hasNext(): + raise StopIteration + val = getattr(self.enumeration.next().value, 'inst') + if val is None: + raise StopIteration + return cmpi2pywbem_inst(val) + + class BrokerCIMOMHandle(object): - def __init__(self, broker, ns): + def __init__(self, broker, ctx): self.broker = broker - self.default_namespace = ns - def EnumerateInstanceNames(self): - pass - def EnumerateInstances(self): - pass - def GetInstance(self): - pass + self.ctx = ctx + + def EnumerateInstanceNames(self, ns, cn): + cop = cmpi.CMPIObjectPath(ns, cn) + e = self.broker.enumInstanceNames(self.ctx, cop) + return CIMInstanceNameIterator(e) + + def EnumerateInstances(self, ns, cn, props = None): + cop = cmpi.CMPIObjectPath(ns, cn) + e = self.broker.enumInstances(self.ctx, cop, props) + return CIMInstanceIterator(e) + + def GetInstance(self, path, props = None): + cop = pywbem2cmpi_instname(path) + ci = self.broker.getInstance(self.ctx, cop, props) + if ci is None: + return None + return cmpi2pywbem_inst(ci) + def Associators(self): pass def AssociatorNames(self): @@ -85,10 +128,13 @@ class ProviderEnvironment(object): def __init__(self, broker): self.broker = broker + self.ctx = None def get_logger(self): return Logger(self.broker) def get_cimom_handle(self): return SFCBUDSConnection() + def get_cimom_handle2(self): + return BrokerCIMOMHandle(self.broker, self.ctx) def get_user_name(self): pass def get_context_value(self, key): @@ -119,8 +165,7 @@ def enum_instance_names(self, ctx, rslt, objname): print 'provider.py: In enum_instance_names()' #test_conversions() - - + self.env.ctx = ctx op = cmpi2pywbem_instname(objname) conn = SFCBUDSConnection() try: @@ -131,11 +176,10 @@ return args[:2] rslt.done() return (0, '') - def enum_instances(self, ctx, rslt, objname, plist): print 'provider.py: In enum_instances()' - + self.env.ctx = ctx op = cmpi2pywbem_instname(objname) conn = SFCBUDSConnection() try: @@ -147,9 +191,9 @@ rslt.done() return (0, '') - def get_instance(self, ctx, rslt, objname, plist): print 'provider.py: In get_instance()' + self.env.ctx = ctx op = cmpi2pywbem_instname(objname) conn = SFCBUDSConnection() try: @@ -163,6 +207,7 @@ def create_instance(self, ctx, rslt, objname, newinst): + self.env.ctx = ctx pinst = cmpi2pywbem_inst(newinst) try: piname = self.proxy.MI_createInstance(self.env, pinst) @@ -175,6 +220,7 @@ def set_instance(self, ctx, rslt, objname, newinst, plist): + self.env.ctx = ctx pinst = cmpi2pywbem_inst(newinst) pinst.path = cmpi2pywbem_instname(objname) try: @@ -198,6 +244,7 @@ def associator_names(self, ctx, rslt, objName, assocClass, resultClass, role, resultRole): + self.env.ctx = ctx piname = cmpi2pywbem_instname(objName) try: @@ -212,6 +259,7 @@ def associators(self, ctx, rslt, objName, assocClass, resultClass, role, resultRole, props): + self.env.ctx = ctx piname = cmpi2pywbem_instname(objName) try: @@ -227,6 +275,7 @@ def reference_names(self, ctx, rslt, objName, resultClass, role): print 'pycmpi_provider.py: In reference_names()' + self.env.ctx = ctx piname = cmpi2pywbem_instname(objName) try: @@ -241,6 +290,7 @@ def references(self, ctx, rslt, objName, resultClass, role, props): + self.env.ctx = ctx piname = cmpi2pywbem_instname(objName) try: @@ -256,6 +306,7 @@ def invoke_method(self, ctx, rslt, objName, method, inargs, outargs): print '*** in invoke_method' + self.env.ctx = ctx op = cmpi2pywbem_instname(objName) pinargs = cmpi2pywbem_args(inargs) try: @@ -274,15 +325,18 @@ def authorize_filter(self, ctx, filter, className, classPath, owner): + self.env.ctx = ctx pass def activate_filter(self, ctx, filter, className, classPath, firstActivation): + self.env.ctx = ctx pass def deactivate_filter(self, ctx, filter, className, classPath, lastActivation): + self.env.ctx = ctx pass @@ -290,13 +344,16 @@ #def must_poll(self, ctx, rslt, filter, className, classPath): # NOTE: sfcb signature for this doesn't have the rslt. def must_poll(self, ctx, filter, className, classPath): + self.env.ctx = ctx pass def enable_indications(self, ctx): + self.env.ctx = ctx pass def disable_indications(self, ctx): + self.env.ctx = ctx pass Modified: cmpi-bindings/trunk/test/python/TestMethod.py =================================================================== --- cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-10 23:04:23 UTC (rev 941) +++ cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-10 23:37:05 UTC (rev 942) @@ -47,6 +47,23 @@ logger.log_debug('Entering %s.enum_instances()' \ % self.__class__.__name__) + ''' + ch = env.get_cimom_handle2() + keys = { + 'CreationClassName':'Linux_EthernetPort', + 'DeviceID':'0011D8378654', + 'SystemCreationClassName':'Linux_ComputerSystem', + 'SystemName':'redbird.austin.rr.com' } + + path = pywbem.CIMInstanceName( + 'Linux_EthernetPort', + namespace='root/cimv2', + keybindings=keys); + + inst = ch.GetInstance(path); + print inst + ''' + for key in g_insts.keys(): model['id'] = key model.path['id'] = key This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-10 23:04:12
|
Revision: 941 http://omc.svn.sourceforge.net/omc/?rev=941&view=rev Author: bartw Date: 2008-09-10 23:04:23 +0000 (Wed, 10 Sep 2008) Log Message: ----------- some adjustments concerning PropertyList Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cim_provider.py Modified: cmpi-bindings/trunk/swig/python/cim_provider.py =================================================================== --- cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-10 22:23:40 UTC (rev 940) +++ cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-10 23:04:23 UTC (rev 941) @@ -560,33 +560,11 @@ plist = None if propertyList is not None: plist = [s.lower() for s in propertyList] - ''' - keyNames = get_keys_from_class(cimClass) - plist = None - if propertyList is not None: - lkns = [kn.lower() for kn in keyNames] - props = pywbem.NocaseDict() - plist = [s.lower() for s in propertyList] - pklist = plist + lkns - [props.__setitem__(p.name, p) for p in cimClass.properties.values() - if p.name.lower() in pklist] - else: - props = cimClass.properties - _strip_quals(props) - ''' + plist+= [s.lower() for s in instanceName.keybindings.keys()] model = pywbem.CIMInstance(classname=instanceName.classname, - path=instanceName) + path=instanceName, property_list=plist) model.update(model.path.keybindings) - ''' - for k, v in instanceName.keybindings.items(): - type = cimClass.properties[k].type - if type != 'reference': - v = val = pywbem.tocimobj(type, v) - model.__setitem__(k, pywbem.CIMProperty(name=k, type=type, - value=v)) - ''' - rval = self.get_instance(env=env, model=model, property_list=plist) @@ -643,8 +621,10 @@ logger.log_debug('CIMProvider MI_modifyInstance called...') plist = None if propertyList is not None: - plist = [p.lower() for p in propertyList] + plist = [s.lower() for s in propertyList] + plist+= [s.lower() for s in modifiedInstance.path.keybindings.keys()] filter_instance(modifiedInstance, plist) + modifiedInstance.property_list = plist modifiedInstance.update(modifiedInstance.path) self.set_instance(env=env, instance=modifiedInstance, @@ -969,7 +949,9 @@ if plist is not None: for pname in inst.properties.keys(): - if pname.lower() not in plist: + if pname.lower() not in plist and pname: + if inst.path is not None and pname in inst.path.keybindings: + continue del inst.properties[pname] def get_keys_from_class(cc): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-10 22:23:29
|
Revision: 940 http://omc.svn.sourceforge.net/omc/?rev=940&view=rev Author: bartw Date: 2008-09-10 22:23:40 +0000 (Wed, 10 Sep 2008) Log Message: ----------- added a new TODO item Modified Paths: -------------- cmpi-bindings/trunk/TODO Modified: cmpi-bindings/trunk/TODO =================================================================== --- cmpi-bindings/trunk/TODO 2008-09-10 22:23:14 UTC (rev 939) +++ cmpi-bindings/trunk/TODO 2008-09-10 22:23:40 UTC (rev 940) @@ -18,3 +18,7 @@ toplevel function which raised the execption ?] Wrap CMPIEnumeration and CMPIArray in typemaps. + +Wrap CMPIBrokerEncFT.classPathIsA() + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-10 22:23:06
|
Revision: 939 http://omc.svn.sourceforge.net/omc/?rev=939&view=rev Author: bartw Date: 2008-09-10 22:23:14 +0000 (Wed, 10 Sep 2008) Log Message: ----------- renamed previous_instance parameter to modify_existing, update docs, adjusted codegen to new interface. Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cim_provider.py Modified: cmpi-bindings/trunk/swig/python/cim_provider.py =================================================================== --- cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-10 22:22:34 UTC (rev 938) +++ cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-10 22:23:14 UTC (rev 939) @@ -285,7 +285,7 @@ request. Only properties present in the model need to be given values. If you prefer, you can set all of the values, and the instance will be filtered for you. - cim_class -- The pywbem.CIMClass + property_list -- The PropertyList from the request. Possible Errors: CIM_ERR_ACCESS_DENIED @@ -313,7 +313,7 @@ the model need to be given values. If you prefer, you can always set all of the values, and the instance will be filtered for you. - cim_class -- The pywbem.CIMClass + property_list -- The PropertyList from the request. keys_only -- A boolean. True if only the key properties should be set on the generated instances. @@ -323,7 +323,7 @@ """ pass - def set_instance(self, env, instance, previous_instance, property_list): + def set_instance(self, env, instance, modify_existing, property_list): """Return a newly created or modified instance. Keyword arguments: @@ -331,9 +331,8 @@ instance -- The new pywbem.CIMInstance. If modifying an existing instance, the properties on this instance have been filtered by the PropertyList from the request. - previous_instance -- The previous pywbem.CIMInstance if modifying - an existing instance. None if creating a new instance. - cim_class -- The pywbem.CIMClass + modify_existing -- True if ModifyInstance, False if CreateInstance + property_list -- The PropertyList from the request. Return the new instance. The keys must be set on the new instance. @@ -343,10 +342,10 @@ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized or otherwise incorrect parameters) CIM_ERR_ALREADY_EXISTS (the CIM Instance already exists -- only - valid if previous_instance is None, indicating that the operation + valid if modify_existing is False, indicating that the operation was CreateInstance) CIM_ERR_NOT_FOUND (the CIM Instance does not exist -- only valid - if previous_instance is not None, indicating that the operation + if modify_existing is True, indicating that the operation was ModifyInstance) CIM_ERR_FAILED (some other unspecified error occurred) @@ -623,7 +622,7 @@ # props with default values, if values not supplied by client. rval = self.set_instance(env=env, instance=instance, - previous_instance=None, + modify_existing=False, property_list=None) logger.log_debug('CIMProvider MI_createInstance returning') return rval.path @@ -649,7 +648,7 @@ modifiedInstance.update(modifiedInstance.path) self.set_instance(env=env, instance=modifiedInstance, - previous_instance=True, + modify_existing=True, property_list=plist) logger.log_debug('CIMProvider MI_modifyInstance returning') @@ -1231,8 +1230,9 @@ """ import pywbem +from cim_provider import CIMProvider -class %(classname)sProvider(pywbem.CIMProvider): +class %(classname)sProvider(CIMProvider): """Instrument the CIM class %(classname)s \n''' % mappings code+= format_desc(cc, 4) code+= ''' @@ -1262,7 +1262,6 @@ keyProps = [p for p in cc.properties.values() \ if 'key' in p.qualifiers] code+= ''' - ux = model.update_existing # TODO fetch system resource matching the following keys:''' for kp in keyProps: @@ -1274,9 +1273,7 @@ for prop in props: if 'key' in prop.qualifiers: continue - #line = "#ux(%s=%s) # TODO (type = %s) %s" % \ - # (prop.name, type_hint(prop), type_str(prop), is_required(prop)) - line = "#ux(%s=%s) # TODO %s" % \ + line = "#model['%s'] = %s # TODO %s" % \ (prop.name, type_hint(prop), is_required(prop)) code+= ''' %s''' % line @@ -1292,16 +1289,25 @@ logger = env.get_logger() logger.log_debug('Entering %%s.enum_instances()' \\ %% self.__class__.__name__) + ''' % (args, CIMProvider.enum_instances.__doc__) + kd = dict([(kp.name, None) for kp in keyProps]) + code+= ''' + # Prime model.path with knowledge of the keys, so key values on + # the CIMInstanceName (model.path) will automatically be set when + # we set property values on the model. + model.path.update(%s) + ''' % str(kd) + code+= ''' while False: # TODO more instances? # TODO fetch system resource - # Key properties''' % (args, CIMProvider.enum_instances.__doc__) + # Key properties''' for kp in keyProps: if kp.name == 'CreationClassName': line = "model['%s'] = '%s'" % (kp.name, cc.classname) else: - line = "#model['%s'] = # TODO (type = %s)" % \ - (kp.name, type_str(kp)) + line = "#model['%s'] = %s # TODO (type = %s)" % \ + (kp.name, type_hint(kp), type_str(kp)) code+=''' %s''' % line code+=''' @@ -1309,7 +1315,7 @@ yield model else: try: - yield self.get_instance(env, model, cim_class) + yield self.get_instance(env, model, property_list) except pywbem.CIMError, (num, msg): if num not in (pywbem.CIM_ERR_NOT_FOUND, pywbem.CIM_ERR_ACCESS_DENIED): @@ -1349,7 +1355,7 @@ outParms = [ p for p in method.parameters.values() if \ 'out' in p.qualifiers and p.qualifiers['out'].value ] code+= ''' - def cim_method_%s(self, env, object_name, method''' % method.name.lower() + def cim_method_%s(self, env, object_name''' % method.name.lower() for p in inParms: code+= ''',\n%sparam_%s''' % (''.rjust(len(method.name)+20), p.name.lower()) @@ -1362,8 +1368,7 @@ env -- Provider Environment (pycimmb.ProviderEnvironment) object_name -- A pywbem.CIMInstanceName or pywbem.CIMCLassName specifying the object on which the method %s() - should be invoked. - method -- A pywbem.CIMMethod representing the method meta-data'''\ + should be invoked.'''\ % method.name for p in inParms: @@ -1376,7 +1381,7 @@ code+=''' Returns a two-tuple containing the return value (type %s) - and a dictionary with the out-parameters + and a list of CIMParameter objects representing the output parameters Output parameters:''' % type_str(method) @@ -1409,15 +1414,16 @@ # TODO do something raise pywbem.CIMError(pywbem.CIM_ERR_METHOD_NOT_AVAILABLE) # Remove to implemented - out_params = {}''' % method.name.lower() + out_params = []''' % method.name.lower() for p in outParms: code+=''' - #out_params['%s'] = %s # TODO''' % (p.name.lower(), + #out_params+= [pywbem.CIMParameter('%s', type='%s', + # value=%s)] # TODO''' % (p.name.lower(), p.type, type_hint(p, method.name)) code+=''' - rval = None # TODO (type %s) + #rval = # TODO (type %s) return (rval, out_params) ''' % type_str(method) @@ -1485,17 +1491,20 @@ owtypes = ['1', 'Instance'] pegtypes = ['2', 'Instance'] + sfcbtypes = 'instance' if isAssoc: owtypes[0]+= ',3' owtypes[1]+= ', Associator' pegtypes[0]+= ',3' pegtypes[1]+= ', Associator' + sfcbtypes+= ' association' if cc.methods: owtypes[0]+= ',6' owtypes[1]+= ', Method' pegtypes[0]+= ',5' pegtypes[1]+= ', Method' - mof =''' + sfcbtypes+= ' method' + omitted = ''' // OpenWBEM Provider registration for %(classname)s instance of OpenWBEM_PyProviderRegistration { @@ -1505,7 +1514,16 @@ ProviderTypes = {%(owtypeNums)s}; // %(owtypeStrs)s ModulePath = "/usr/lib/pycim/%(classname)sProvider.py"; // TODO }; + ''' + mof =''' +// SFCB Provider registration for %(classname)s +[%(classname)s] + provider: %(classname)sProvider + location: pyCmpiProvider + type: %(sfcbtypes)s + namespace: root/cimv2 // TODO + // Pegasus Provider registration for %(classname)s instance of PG_ProviderModule { @@ -1534,7 +1552,8 @@ 'owtypeNums': owtypes[0], 'owtypeStrs': owtypes[1], 'pegtypeNum': pegtypes[0], - 'pegtypeStr': pegtypes[1]} + 'pegtypeStr': pegtypes[1], + 'sfcbtypes' : sfcbtypes} return code, mof This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-10 22:22:23
|
Revision: 938 http://omc.svn.sourceforge.net/omc/?rev=938&view=rev Author: bartw Date: 2008-09-10 22:22:34 +0000 (Wed, 10 Sep 2008) Log Message: ----------- renamed a parameter Modified Paths: -------------- cmpi-bindings/trunk/test/python/TestMethod.py Modified: cmpi-bindings/trunk/test/python/TestMethod.py =================================================================== --- cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-10 22:17:57 UTC (rev 937) +++ cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-10 22:22:34 UTC (rev 938) @@ -60,12 +60,12 @@ pywbem.CIM_ERR_ACCESS_DENIED): raise - def set_instance(self, env, instance, previous_instance, property_list): + def set_instance(self, env, instance, modify_existing, property_list): logger = env.get_logger() logger.log_debug('Entering %s.set_instance()' \ % self.__class__.__name__) - if previous_instance: + if modify_existing: if instance['id'] not in g_insts: raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND) else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-10 22:17:47
|
Revision: 937 http://omc.svn.sourceforge.net/omc/?rev=937&view=rev Author: bartw Date: 2008-09-10 22:17:57 +0000 (Wed, 10 Sep 2008) Log Message: ----------- renamed a parameter Modified Paths: -------------- cmpi-bindings/trunk/test/python/TestAssocProvider.py cmpi-bindings/trunk/test/python/TestAtomProvider.py Modified: cmpi-bindings/trunk/test/python/TestAssocProvider.py =================================================================== --- cmpi-bindings/trunk/test/python/TestAssocProvider.py 2008-09-10 22:16:39 UTC (rev 936) +++ cmpi-bindings/trunk/test/python/TestAssocProvider.py 2008-09-10 22:17:57 UTC (rev 937) @@ -83,7 +83,7 @@ for pwent in pwd.getpwall(): yield get_user_instance(pwent[2], model, keys_only) - def set_instance(self, env, instance, previous_instance, property_list): + def set_instance(self, env, instance, modify_existing, property_list): raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) def delete_instance(self, env, instance_name): @@ -108,7 +108,7 @@ for grent in grp.getgrall(): yield get_group_instance(grent[2], model, keys_only) - def set_instance(self, env, instance, previous_instance, property_list): + def set_instance(self, env, instance, modify_existing, property_list): raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) def delete_instance(self, env, instance_name): @@ -156,7 +156,7 @@ model['isPrimaryGroup'] = False yield model - def set_instance(self, env, instance, previous_instance, property_list): + def set_instance(self, env, instance, modify_existing, property_list): raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) def delete_instance(self, env, instance_name): Modified: cmpi-bindings/trunk/test/python/TestAtomProvider.py =================================================================== --- cmpi-bindings/trunk/test/python/TestAtomProvider.py 2008-09-10 22:16:39 UTC (rev 936) +++ cmpi-bindings/trunk/test/python/TestAtomProvider.py 2008-09-10 22:17:57 UTC (rev 937) @@ -115,7 +115,7 @@ pywbem.CIM_ERR_ACCESS_DENIED): raise - def set_instance(self, env, instance, previous_instance, property_list): + def set_instance(self, env, instance, modify_existing, property_list): """Return a newly created or modified instance. Keyword arguments: @@ -148,7 +148,7 @@ logger.log_debug('Entering %s.set_instance()' \ % self.__class__.__name__) - if previous_instance: + if modify_existing: if instance['Name'] not in self.storage: raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND) inst = self.storage[instance.path['Name']] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-10 22:16:29
|
Revision: 936 http://omc.svn.sourceforge.net/omc/?rev=936&view=rev Author: bartw Date: 2008-09-10 22:16:39 +0000 (Wed, 10 Sep 2008) Log Message: ----------- replace example provider with one created from new codegen Modified Paths: -------------- cmpi-bindings/trunk/swig/python/Py_UnixProcessProvider.py Modified: cmpi-bindings/trunk/swig/python/Py_UnixProcessProvider.py =================================================================== --- cmpi-bindings/trunk/swig/python/Py_UnixProcessProvider.py 2008-09-10 16:50:05 UTC (rev 935) +++ cmpi-bindings/trunk/swig/python/Py_UnixProcessProvider.py 2008-09-10 22:16:39 UTC (rev 936) @@ -5,11 +5,11 @@ """ import pywbem +from cim_provider import CIMProvider + import os from socket import getfqdn -from cim_provider import CIMProvider - class Py_UnixProcessProvider(CIMProvider): """Instrument the CIM class Py_UnixProcess @@ -38,7 +38,7 @@ request. Only properties present in the model need to be given values. If you prefer, you can set all of the values, and the instance will be filtered for you. - cim_class -- The pywbem.CIMClass + property_list -- The PropertyList from the request. Possible Errors: CIM_ERR_ACCESS_DENIED @@ -54,52 +54,66 @@ logger.log_debug('Entering %s.get_instance()' \ % self.__class__.__name__) + # TODO fetch system resource matching the following keys: # model['CreationClassName'] # model['OSCreationClassName'] # model['Handle'] + # model['CSCreationClassName'] # model['OSName'] - # model['CSCreationClassName'] # model['CSName'] - - model['CreationClassName'] = model.path['CreationClassName'] - model['OSCreationClassName'] = model.path['OSCreationClassName'] - model['Handle'] = model.path['Handle'] - model['OSName'] = model.path['OSName'] - model['CSCreationClassName'] = model.path['CSCreationClassName'] - model['CSName'] = model.path['CSName'] + # - #model.update_existing(Caption=<value>) # TODO (type = unicode) - #model.update_existing(CreationDate=<value>) # TODO (type = pywbem.CIMDateTime) - #model.update_existing(Description=<value>) # TODO (type = unicode) - #model.update_existing(ElementName=<value>) # TODO (type = unicode) - #model.update_existing(EnabledDefault=<value>) # TODO (type = pywbem.Uint16 self.Values.EnabledDefault) (default=2L) - #model.update_existing(EnabledState=<value>) # TODO (type = pywbem.Uint16 self.Values.EnabledState) (default=5L) - #model.update_existing(ExecutionState=<value>) # TODO (type = pywbem.Uint16 self.Values.ExecutionState) - #model.update_existing(HealthState=<value>) # TODO (type = pywbem.Uint16 self.Values.HealthState) - #model.update_existing(InstallDate=<value>) # TODO (type = pywbem.CIMDateTime) - #model.update_existing(KernelModeTime=<value>) # TODO (type = pywbem.Uint64) - #model.update_existing(ModulePath=<value>) # TODO (type = unicode) - #model.update_existing(Name=<value>) # TODO (type = unicode) - #model.update_existing(OperationalStatus=<value>) # TODO (type = [pywbem.Uint16,] self.Values.OperationalStatus) - #model.update_existing(OtherEnabledState=<value>) # TODO (type = unicode) - #model.update_existing(OtherExecutionDescription=<value>) # TODO (type = unicode) - #model.update_existing(Parameters=<value>) # TODO (type = [unicode,]) - #model.update_existing(ParentProcessID=<value>) # TODO (type = unicode) (Required) - #model.update_existing(Priority=<value>) # TODO (type = pywbem.Uint32) - #model.update_existing(ProcessGroupID=<value>) # TODO (type = pywbem.Uint64) (Required) - #model.update_existing(ProcessNiceValue=<value>) # TODO (type = pywbem.Uint32) - #model.update_existing(ProcessSessionID=<value>) # TODO (type = pywbem.Uint64) - #model.update_existing(ProcessTTY=<value>) # TODO (type = unicode) - #model.update_existing(ProcessWaitingForEvent=<value>) # TODO (type = unicode) - #model.update_existing(RealUserID=<value>) # TODO (type = pywbem.Uint64) (Required) - #model.update_existing(RequestedState=<value>) # TODO (type = pywbem.Uint16 self.Values.RequestedState) (default=12L) - #model.update_existing(Status=<value>) # TODO (type = unicode self.Values.Status) - #model.update_existing(StatusDescriptions=<value>) # TODO (type = [unicode,]) - #model.update_existing(TerminationDate=<value>) # TODO (type = pywbem.CIMDateTime) - #model.update_existing(TimeOfLastStateChange=<value>) # TODO (type = pywbem.CIMDateTime) - #model.update_existing(UserModeTime=<value>) # TODO (type = pywbem.Uint64) - #model.update_existing(WorkingSetSize=<value>) # TODO (type = pywbem.Uint64) + pid = model['handle'] + if not os.path.exists('/proc/' + pid): + raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND) + + fo = open('/proc/'+pid+'/stat', 'r') + st = fo.read() + fo.close() + head, sep, tail = st.partition('(') + name, sep, tail = tail.partition(')') + model['Name'] = name + + #model['AvailableRequestedStates'] = [self.Values.AvailableRequestedStates.<VAL>,] # TODO + #model['Caption'] = '' # TODO + #model['CommunicationStatus'] = self.Values.CommunicationStatus.<VAL> # TODO + #model['CreationDate'] = pywbem.CIMDateTime() # TODO + #model['Description'] = '' # TODO + #model['DetailedStatus'] = self.Values.DetailedStatus.<VAL> # TODO + #model['ElementName'] = '' # TODO + #model['EnabledDefault'] = self.Values.EnabledDefault.Enabled # TODO + #model['EnabledState'] = self.Values.EnabledState.Not_Applicable # TODO + #model['ExecutionState'] = self.Values.ExecutionState.<VAL> # TODO + #model['Generation'] = pywbem.Uint64() # TODO + #model['HealthState'] = self.Values.HealthState.<VAL> # TODO + #model['InstallDate'] = pywbem.CIMDateTime() # TODO + #model['InstanceID'] = '' # TODO + #model['KernelModeTime'] = pywbem.Uint64() # TODO + #model['ModulePath'] = '' # TODO + #model['OperatingStatus'] = self.Values.OperatingStatus.<VAL> # TODO + #model['OperationalStatus'] = [self.Values.OperationalStatus.<VAL>,] # TODO + #model['OtherEnabledState'] = '' # TODO + #model['OtherExecutionDescription'] = '' # TODO + #model['Parameters'] = ['',] # TODO + #model['ParentProcessID'] = '' # TODO (Required) + #model['PrimaryStatus'] = self.Values.PrimaryStatus.<VAL> # TODO + #model['Priority'] = pywbem.Uint32(0) # TODO + #model['ProcessGroupID'] = pywbem.Uint64() # TODO (Required) + #model['ProcessNiceValue'] = pywbem.Uint32() # TODO + #model['ProcessSessionID'] = pywbem.Uint64() # TODO + #model['ProcessTTY'] = '' # TODO + #model['ProcessWaitingForEvent'] = '' # TODO + #model['RealUserID'] = pywbem.Uint64() # TODO (Required) + #model['RequestedState'] = self.Values.RequestedState.Not_Applicable # TODO + #model['Status'] = self.Values.Status.<VAL> # TODO + #model['StatusDescriptions'] = ['',] # TODO + #model['TerminationDate'] = pywbem.CIMDateTime() # TODO + #model['TimeOfLastStateChange'] = pywbem.CIMDateTime() # TODO + #model['TransitioningToState'] = self.Values.TransitioningToState.Not_Applicable # TODO + #model['UnixPriority'] = pywbem.Sint32() # TODO + #model['UserModeTime'] = pywbem.Uint64() # TODO + #model['WorkingSetSize'] = pywbem.Uint64() # TODO return model def enum_instances(self, env, model, property_list, keys_only): @@ -117,7 +131,7 @@ the model need to be given values. If you prefer, you can always set all of the values, and the instance will be filtered for you. - cim_class -- The pywbem.CIMClass + property_list -- The PropertyList from the request. keys_only -- A boolean. True if only the key properties should be set on the generated instances. @@ -129,22 +143,21 @@ logger = env.get_logger() logger.log_debug('Entering %s.enum_instances()' \ % self.__class__.__name__) - + + # Prime model.path with knowledge of the keys, so key values on + # the CIMInstanceName (model.path) will automatically be set when + # we set property values on the model. + model.path.update({u'Handle': None, u'CSName': None, u'OSName': None, u'CSCreationClassName': None, u'OSCreationClassName': None, u'CreationClassName': None}) + model['CreationClassName'] = 'Py_UnixProcess' - model.path['CreationClassName'] = 'Py_UnixProcess' - model['OSCreationClassName'] = 'CIM_UnitaryComputerSystem' - model.path['OSCreationClassName'] = 'CIM_UnitaryComputerSystem' + model['OSCreationClassName'] = 'CIM_OperatingSystem' + model['CSCreationClassName'] = 'CIM_ComputerSystem' model['OSName'] = 'Linux' - model.path['OSName'] = 'Linux' - model['CSCreationClassName'] = 'CIM_ComputerSystem' - model.path['CSCreationClassName'] = 'CIM_ComputerSystem' model['CSName'] = getfqdn() - model.path['CSName'] = getfqdn() for file in os.listdir('/proc'): if not file.isdigit(): continue model['Handle'] = file - model.path['Handle'] = file if keys_only: yield model else: @@ -155,7 +168,7 @@ pywbem.CIM_ERR_ACCESS_DENIED): raise - def set_instance(self, env, instance, previous_instance, cim_class): + def set_instance(self, env, instance, modify_existing, property_list): """Return a newly created or modified instance. Keyword arguments: @@ -163,9 +176,8 @@ instance -- The new pywbem.CIMInstance. If modifying an existing instance, the properties on this instance have been filtered by the PropertyList from the request. - previous_instance -- The previous pywbem.CIMInstance if modifying - an existing instance. None if creating a new instance. - cim_class -- The pywbem.CIMClass + modify_existing -- True if ModifyInstance, False if CreateInstance + property_list -- The PropertyList from the request. Return the new instance. The keys must be set on the new instance. @@ -175,10 +187,10 @@ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized or otherwise incorrect parameters) CIM_ERR_ALREADY_EXISTS (the CIM Instance already exists -- only - valid if previous_instance is None, indicating that the operation + valid if modify_existing is False, indicating that the operation was CreateInstance) CIM_ERR_NOT_FOUND (the CIM Instance does not exist -- only valid - if previous_instance is not None, indicating that the operation + if modify_existing is True, indicating that the operation was ModifyInstance) CIM_ERR_FAILED (some other unspecified error occurred) @@ -220,7 +232,7 @@ # TODO delete the resource raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) # Remove to implement - def cim_method_requeststatechange(self, env, object_name, method, + def cim_method_requeststatechange(self, env, object_name, param_requestedstate, param_timeoutperiod): """Implements Py_UnixProcess.RequestStateChange() @@ -230,45 +242,47 @@ state change takes place, the EnabledState and RequestedState of the element will be the same. Invoking the RequestStateChange method multiple times could result in earlier requests being - overwritten or lost. If 0 is returned, then the task completed - successfully and the use of ConcreteJob was not required. If 4096 - (0x1000) is returned, then the task will take some time to - complete, ConcreteJob will be created, and its reference returned - in the output parameter Job. Any other return code indicates an - error condition. + overwritten or lost. \nA return code of 0 shall indicate the state + change was successfully initiated. \nA return code of 3 shall + indicate that the state transition cannot complete within the + interval specified by the TimeoutPeriod parameter. \nA return code + of 4096 (0x1000) shall indicate the state change was successfully + initiated, a ConcreteJob has been created, and its reference + returned in the output parameter Job. Any other return code + indicates an error condition. Keyword arguments: env -- Provider Environment (pycimmb.ProviderEnvironment) object_name -- A pywbem.CIMInstanceName or pywbem.CIMCLassName specifying the object on which the method RequestStateChange() should be invoked. - method -- A pywbem.CIMMethod representing the method meta-data param_requestedstate -- The input parameter RequestedState (type pywbem.Uint16 self.Values.RequestStateChange.RequestedState) The state requested for the element. This information will be placed into the RequestedState property of the instance if the - return code of the RequestStateChange method is 0 ('Completed - with No Error'), 3 ('Timeout'), or 4096 (0x1000) ('Job - Started'). Refer to the description of the EnabledState and - RequestedState properties for the detailed explanations of the - RequestedState values. + return code of the RequestStateChange method is 0 (\'Completed + with No Error\'), or 4096 (0x1000) (\'Job Started\'). Refer to + the description of the EnabledState and RequestedState + properties for the detailed explanations of the RequestedState + values. param_timeoutperiod -- The input parameter TimeoutPeriod (type pywbem.CIMDateTime) A timeout period that specifies the maximum amount of time that the client expects the transition to the new state to take. The interval format must be used to specify the TimeoutPeriod. A value of 0 or a null parameter indicates that the client has - no time requirements for the transition. If this property + no time requirements for the transition. \nIf this property does not contain 0 or null and the implementation does not - support this parameter, a return code of 'Use Of Timeout - Parameter Not Supported' must be returned. + support this parameter, a return code of \'Use Of Timeout + Parameter Not Supported\' shall be returned. Returns a two-tuple containing the return value (type pywbem.Uint32 self.Values.RequestStateChange) - and a dictionary with the out-parameters + and a list of CIMParameter objects representing the output parameters Output parameters: Job -- (type REF (pywbem.CIMInstanceName(classname='CIM_ConcreteJob', ...)) - Reference to the job (can be null if the task is completed). + May contain a reference to the ConcreteJob created to track the + state transition initiated by the method invocation. Possible Errors: @@ -289,12 +303,13 @@ # TODO do something raise pywbem.CIMError(pywbem.CIM_ERR_METHOD_NOT_AVAILABLE) # Remove to implemented - out_params = {} - #out_params['job'] = # TODO (type REF (pywbem.CIMInstanceName(classname='CIM_ConcreteJob', ...)) - rval = None # TODO (type pywbem.Uint32 self.Values.RequestStateChange) + out_params = [] + #out_params+= [pywbem.CIMParameter('job', type='reference', + # value=pywbem.CIMInstanceName(classname='CIM_ConcreteJob', ...))] # TODO + #rval = # TODO (type pywbem.Uint32 self.Values.RequestStateChange) return (rval, out_params) - def cim_method_kill(self, env, object_name, method, + def cim_method_kill(self, env, object_name, param_signal): """Implements Py_UnixProcess.kill() @@ -305,13 +320,12 @@ object_name -- A pywbem.CIMInstanceName or pywbem.CIMCLassName specifying the object on which the method kill() should be invoked. - method -- A pywbem.CIMMethod representing the method meta-data param_signal -- The input parameter signal (type pywbem.Uint16 self.Values.kill.signal) The signal to send the process Returns a two-tuple containing the return value (type pywbem.Sint32) - and a dictionary with the out-parameters + and a list of CIMParameter objects representing the output parameters Output parameters: none @@ -331,7 +345,6 @@ logger.log_debug('Entering %s.cim_method_kill()' \ % self.__class__.__name__) - pid = object_name['handle'] if not os.path.isdir('/proc/' + pid): raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND, @@ -341,27 +354,23 @@ os.kill(int(pid), param_signal) except OSError, arg: rval = pwbem.Sint32(arg.errno) - out_params = {} # kill() has not output parameters + out_params = [] return (rval, out_params) class Values(object): - class Status(object): - OK = 'OK' - Error = 'Error' - Degraded = 'Degraded' - Unknown = 'Unknown' - Pred_Fail = 'Pred Fail' - Starting = 'Starting' - Stopping = 'Stopping' - Service = 'Service' - Stressed = 'Stressed' - NonRecover = 'NonRecover' - No_Contact = 'No Contact' - Lost_Comm = 'Lost Comm' - Stopped = 'Stopped' + class DetailedStatus(object): + Not_Available = pywbem.Uint16(0) + No_Additional_Information = pywbem.Uint16(1) + Stressed = pywbem.Uint16(2) + Predictive_Failure = pywbem.Uint16(3) + Non_Recoverable_Error = pywbem.Uint16(4) + Supporting_Entity_in_Error = pywbem.Uint16(5) + # DMTF_Reserved = .. + # Vendor_Reserved = 0x8000.. class RequestedState(object): + Unknown = pywbem.Uint16(0) Enabled = pywbem.Uint16(2) Disabled = pywbem.Uint16(3) Shut_Down = pywbem.Uint16(4) @@ -386,19 +395,19 @@ Non_recoverable_error = pywbem.Uint16(30) # DMTF_Reserved = .. - class ExecutionState(object): + class TransitioningToState(object): Unknown = pywbem.Uint16(0) - Other = pywbem.Uint16(1) - Ready = pywbem.Uint16(2) - Running = pywbem.Uint16(3) - Blocked = pywbem.Uint16(4) - Suspended_Blocked = pywbem.Uint16(5) - Suspended_Ready = pywbem.Uint16(6) - Terminated = pywbem.Uint16(7) - Stopped = pywbem.Uint16(8) - Growing = pywbem.Uint16(9) - Ready_But_Relinquished_Processor = pywbem.Uint16(10) - Hung = pywbem.Uint16(11) + Enabled = pywbem.Uint16(2) + Disabled = pywbem.Uint16(3) + Shut_Down = pywbem.Uint16(4) + No_Change = pywbem.Uint16(5) + Offline = pywbem.Uint16(6) + Test = pywbem.Uint16(7) + Defer = pywbem.Uint16(8) + Quiesce = pywbem.Uint16(9) + Reboot = pywbem.Uint16(10) + Reset = pywbem.Uint16(11) + Not_Applicable = pywbem.Uint16(12) class EnabledDefault(object): Enabled = pywbem.Uint16(2) @@ -406,7 +415,8 @@ Not_Applicable = pywbem.Uint16(5) Enabled_but_Offline = pywbem.Uint16(6) No_Default = pywbem.Uint16(7) - # DMTF_Reserved = 8..32767 + Quiesce = pywbem.Uint16(9) + # DMTF_Reserved = .. # Vendor_Reserved = 32768..65535 class EnabledState(object): @@ -424,6 +434,55 @@ # DMTF_Reserved = 11..32767 # Vendor_Reserved = 32768..65535 + class ExecutionState(object): + Unknown = pywbem.Uint16(0) + Other = pywbem.Uint16(1) + Ready = pywbem.Uint16(2) + Running = pywbem.Uint16(3) + Blocked = pywbem.Uint16(4) + Suspended_Blocked = pywbem.Uint16(5) + Suspended_Ready = pywbem.Uint16(6) + Terminated = pywbem.Uint16(7) + Stopped = pywbem.Uint16(8) + Growing = pywbem.Uint16(9) + Ready_But_Relinquished_Processor = pywbem.Uint16(10) + Hung = pywbem.Uint16(11) + + class AvailableRequestedStates(object): + Enabled = pywbem.Uint16(2) + Disabled = pywbem.Uint16(3) + Shut_Down = pywbem.Uint16(4) + Offline = pywbem.Uint16(6) + Test = pywbem.Uint16(7) + Defer = pywbem.Uint16(8) + Quiesce = pywbem.Uint16(9) + Reboot = pywbem.Uint16(10) + Reset = pywbem.Uint16(11) + + class Status(object): + OK = 'OK' + Error = 'Error' + Degraded = 'Degraded' + Unknown = 'Unknown' + Pred_Fail = 'Pred Fail' + Starting = 'Starting' + Stopping = 'Stopping' + Service = 'Service' + Stressed = 'Stressed' + NonRecover = 'NonRecover' + No_Contact = 'No Contact' + Lost_Comm = 'Lost Comm' + Stopped = 'Stopped' + + class CommunicationStatus(object): + Unknown = pywbem.Uint16(0) + Not_Available = pywbem.Uint16(1) + Communication_OK = pywbem.Uint16(2) + Lost_Communication = pywbem.Uint16(3) + No_Contact = pywbem.Uint16(4) + # DMTF_Reserved = .. + # Vendor_Reserved = 0x8000.. + class OperationalStatus(object): Unknown = pywbem.Uint16(0) Other = pywbem.Uint16(1) @@ -447,11 +506,26 @@ # DMTF_Reserved = .. # Vendor_Reserved = 0x8000.. - class kill(object): - class signal(object): - SIGHUP = pywbem.Uint16(1) - SIGKILL = pywbem.Uint16(9) - SIGTERM = pywbem.Uint16(15) + class OperatingStatus(object): + Unknown = pywbem.Uint16(0) + Not_Available = pywbem.Uint16(1) + Servicing = pywbem.Uint16(2) + Starting = pywbem.Uint16(3) + Stopping = pywbem.Uint16(4) + Stopped = pywbem.Uint16(5) + Aborted = pywbem.Uint16(6) + Dormant = pywbem.Uint16(7) + Completed = pywbem.Uint16(8) + Migrating = pywbem.Uint16(9) + Emigrating = pywbem.Uint16(10) + Immigrating = pywbem.Uint16(11) + Snapshotting = pywbem.Uint16(12) + Shutting_Down = pywbem.Uint16(13) + In_Test = pywbem.Uint16(14) + Transitioning = pywbem.Uint16(15) + In_Service = pywbem.Uint16(16) + # DMTF_Reserved = .. + # Vendor_Reserved = 0x8000.. class RequestStateChange(object): Completed_with_No_Error = pywbem.Uint32(0) @@ -481,6 +555,20 @@ # DMTF_Reserved = .. # Vendor_Reserved = 32768..65535 + class kill(object): + class signal(object): + SIGHUP = pywbem.Uint16(1) + SIGKILL = pywbem.Uint16(9) + SIGTERM = pywbem.Uint16(15) + + class PrimaryStatus(object): + Unknown = pywbem.Uint16(0) + OK = pywbem.Uint16(1) + Degraded = pywbem.Uint16(2) + Error = pywbem.Uint16(3) + # DMTF_Reserved = .. + # Vendor_Reserved = 0x8000.. + ## end of class Py_UnixProcessProvider def get_providers(env): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <np...@us...> - 2008-09-10 16:49:54
|
Revision: 935 http://omc.svn.sourceforge.net/omc/?rev=935&view=rev Author: npaxton Date: 2008-09-10 16:50:05 +0000 (Wed, 10 Sep 2008) Log Message: ----------- update TODO - remove 'reload provider on timestamp change' Modified Paths: -------------- cmpi-bindings/trunk/TODO Modified: cmpi-bindings/trunk/TODO =================================================================== --- cmpi-bindings/trunk/TODO 2008-09-10 16:47:46 UTC (rev 934) +++ cmpi-bindings/trunk/TODO 2008-09-10 16:50:05 UTC (rev 935) @@ -18,5 +18,3 @@ toplevel function which raised the execption ?] Wrap CMPIEnumeration and CMPIArray in typemaps. - -Check timestamp on provider modules and reload if modified. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <np...@us...> - 2008-09-10 16:47:36
|
Revision: 934 http://omc.svn.sourceforge.net/omc/?rev=934&view=rev Author: npaxton Date: 2008-09-10 16:47:46 +0000 (Wed, 10 Sep 2008) Log Message: ----------- Reload providers if timestamp is newer - really this time Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cim_provider.py Modified: cmpi-bindings/trunk/swig/python/cim_provider.py =================================================================== --- cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-10 16:44:19 UTC (rev 933) +++ cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-10 16:47:46 UTC (rev 934) @@ -1549,7 +1549,7 @@ self.filename = provid.__file__ else: logger = env.get_logger() - logger.log_debug('Loading python provider at ', provid) + logger.log_debug('Loading python provider at %s' %provid) self._load_provider_source(provid) self._init_provider(env) @@ -1606,7 +1606,7 @@ changed since load, then reload the provider module. """ if (self.provmod_timestamp != os.path.getmtime(self.provid)): - print "Need to reload provider at ", self.provid + print "Need to reload provider at %s" %self.provid #first unload the module if hasattr(self.provmod, "shutdown"): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <np...@us...> - 2008-09-10 16:44:08
|
Revision: 933 http://omc.svn.sourceforge.net/omc/?rev=933&view=rev Author: npaxton Date: 2008-09-10 16:44:19 +0000 (Wed, 10 Sep 2008) Log Message: ----------- Reload providers if timestamp is newer Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cim_provider.py Modified: cmpi-bindings/trunk/swig/python/cim_provider.py =================================================================== --- cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-10 16:30:11 UTC (rev 932) +++ cmpi-bindings/trunk/swig/python/cim_provider.py 2008-09-10 16:44:19 UTC (rev 933) @@ -20,9 +20,9 @@ # Jon Carey #### +import os +"""Python CIM Providers (aka "nirvana") -r"""Python CIM Providers (aka "nirvana") - This module is an abstraction and utility layer between a CIMOM and Python providers. The CIMOM uses this module to load Python providers, and route requests to those providers. @@ -1548,28 +1548,37 @@ self.provid = provid.__name__ self.filename = provid.__file__ else: - self.provid = provid - # odd chars in a module name tend to break things - provider_name = 'pyprovider_' - for ch in provid: - provider_name+= ch.isalnum() and ch or '_' - # let providers import other providers in the same directory - provdir = dirname(provid) - if provdir not in sys.path: - sys.path.append(provdir) - # use full path in module name for uniqueness. - try: - self.provmod = load_source(provider_name, provid) - except IOError, arg: - raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, - "Error loading provider %s: %s" % (provid, arg)) - self.filename = self.provmod.__file__ + logger = env.get_logger() + logger.log_debug('Loading python provider at ', provid) + self._load_provider_source(provid) + self._init_provider(env) + + def _init_provider (self, env): self.provregs = {} if hasattr(self.provmod, 'init'): self.provmod.init(env) if hasattr(self.provmod, 'get_providers'): self.provregs = pywbem.NocaseDict(self.provmod.get_providers(env)) + def _load_provider_source (self, provid): + self.provid = provid + # odd chars in a module name tend to break things + provider_name = 'pyprovider_' + for ch in provid: + provider_name+= ch.isalnum() and ch or '_' + # let providers import other providers in the same directory + provdir = dirname(provid) + if provdir not in sys.path: + sys.path.append(provdir) + # use full path in module name for uniqueness. + try: + self.provmod = load_source(provider_name, provid) + self.provmod_timestamp = os.path.getmtime(provid) + except IOError, arg: + raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, + "Error loading provider %s: %s" % (provid, arg)) + self.filename = self.provmod.__file__ + def _get_callable (self, classname, cname, is_assoc = False): """Return a function or method object appropriate to fulfill a request @@ -1592,6 +1601,25 @@ self.provid)) return callable + def _reload_if_necessary (self, env): + """Check timestamp of loaded python provider module, and if it has + changed since load, then reload the provider module. + """ + if (self.provmod_timestamp != os.path.getmtime(self.provid)): + print "Need to reload provider at ", self.provid + + #first unload the module + if hasattr(self.provmod, "shutdown"): + self.provmod.shutdown(env) + #now reload and reinit module + try: + self._load_provider_source(self.provid) + self._init_provider(env) + except IOError, arg: + raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, + "Error loading provider %s: %s" % (provid, arg)) + + ############################################################################## # enumInstanceNames ############################################################################## @@ -1600,6 +1628,7 @@ objPath): logger = env.get_logger() logger.log_debug('ProviderProxy MI_enumInstanceNames called...') + self._reload_if_necessary(env) for i in self._get_callable(objPath.classname, 'MI_enumInstanceNames') \ (env, objPath): @@ -1615,6 +1644,7 @@ propertyList): logger = env.get_logger() logger.log_debug('CIMProvider MI_enumInstances called...') + self._reload_if_necessary(env) for i in self._get_callable(objPath.classname, 'MI_enumInstances') \ (env, objPath, @@ -1631,6 +1661,7 @@ propertyList): logger = env.get_logger() logger.log_debug('CIMProvider MI_getInstance called...') + self._reload_if_necessary(env) rval = self._get_callable(instanceName.classname, 'MI_getInstance') \ (env, instanceName, @@ -1646,6 +1677,7 @@ instance): logger = env.get_logger() logger.log_debug('CIMProvider MI_createInstance called...') + self._reload_if_necessary(env) rval = self._get_callable(instance.classname, 'MI_createInstance') \ (env, instance) logger.log_debug('CIMProvider MI_createInstance returning') @@ -1660,6 +1692,7 @@ propertyList): logger = env.get_logger() logger.log_debug('CIMProvider MI_modifyInstance called...') + self._reload_if_necessary(env) self._get_callable(modifiedInstance.classname, 'MI_modifyInstance') \ (env, modifiedInstance, propertyList) logger.log_debug('CIMProvider MI_modifyInstance returning') @@ -1672,6 +1705,7 @@ instanceName): logger = env.get_logger() logger.log_debug('CIMProvider MI_deleteInstance called...') + self._reload_if_necessary(env) self._get_callable(instanceName.classname, 'MI_deleteInstance') \ (env, instanceName) logger.log_debug('CIMProvider MI_deleteInstance returning') @@ -1692,6 +1726,7 @@ # and propertyList logger = env.get_logger() logger.log_debug('CIMProvider MI_associators called. assocClass: %s' % (assocClassName)) + self._reload_if_necessary(env) cname = assocClassName if not cname and hasattr(self.provmod, 'MI_associators'): @@ -1741,6 +1776,7 @@ resultRole): logger = env.get_logger() logger.log_debug('CIMProvider MI_associatorNames called. assocClass: %s' % (assocClassName)) + self._reload_if_necessary(env) cname = assocClassName if not cname and hasattr(self.provmod, 'MI_associatorNames'): for i in self.provmod.MI_associatorNames( @@ -1787,6 +1823,7 @@ propertyList): logger = env.get_logger() logger.log_debug('CIMProvider MI_references called. resultClass: %s' % (resultClassName)) + self._reload_if_necessary(env) cname = resultClassName if not cname and hasattr(self.provmod, 'MI_references'): for i in self.provmod.MI_references(env, objectName, @@ -1826,6 +1863,7 @@ role): logger = env.get_logger() logger.log_debug('CIMProvider MI_referenceNames <1> called. resultClass: %s' % (resultClassName)) + self._reload_if_necessary(env) cname = resultClassName if not cname and hasattr(self.provmod, 'MI_referenceNames'): @@ -1871,6 +1909,7 @@ logger = env.get_logger() logger.log_debug('CIMProvider MI_invokeMethod called. method: %s:%s' \ % (objectName.classname,methodName)) + self._reload_if_necessary(env) rval = self._get_callable(objectName.classname, 'MI_invokeMethod') \ (env, objectName, methodName, inputParams) logger.log_debug('CIMProvider MI_invokeMethod returning') @@ -1880,6 +1919,7 @@ def MI_poll (self, env): logger = env.get_logger() logger.log_debug('CIMProvider MI_poll called') + self._reload_if_necessary(env) if hasattr(self.provmod, 'poll'): rval = self.provmod.poll(env) elif hasattr(self.provmod, 'MI_poll'): @@ -1894,6 +1934,7 @@ def MI_getInitialPollingInterval (self, env): logger = env.get_logger() logger.log_debug('CIMProvider MI_poll called') + self._reload_if_necessary(env) if hasattr(self.provmod, 'get_initial_polling_interval'): rval = self.provmod.get_initial_polling_interval(env) elif hasattr(self.provmod, 'MI_getInitialPollingInterval'): @@ -1913,6 +1954,7 @@ firstActivation): logger = env.get_logger() logger.log_debug('CIMProvider MI_activateFilter called') + self._reload_if_necessary(env) if hasattr(self.provmod, 'activate_filter'): self.provmod.activate_filter(env, filter, namespace, classes, firstActivation) @@ -1934,6 +1976,7 @@ lastActivation): logger = env.get_logger() logger.log_debug('CIMProvider MI_deActivateFilter called') + self._reload_if_necessary(env) if hasattr(self.provmod, 'deactivate_filter'): self.provmod.deactivate_filter(env, filter, namespace, classes, lastActivation) @@ -1971,6 +2014,7 @@ logger = env.get_logger() logger.log_debug('ProviderProxy MI_consumeIndication called') + self._reload_if_necessary(env) if hasattr(self.provmod, 'consume_indication'): self.provmod.consume_indication(env, destinationPath, indicationInstance) @@ -1993,6 +2037,7 @@ logger = env.get_logger() logger.log_debug('ProviderProxy MI_handleIndication called') + self._reload_if_necessary(env) if hasattr(self.provmod, 'handle_indication'): self.provmod.handle_indication(env, ns, handlerInstance, indicationInstance) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |