On 10/01/2013 12:02 PM, Hemanth Kumar wrote:
I tried to create a simple provider by following the tutorials from
your previous mail.
I was able to register it. But encountered the following error in
TUT_UnixProcess instances.
Would you please point out the mistakes i am doing
CIM_ERR_FAILED: Error initializing CMPI MI TUT_UnixProcess, the
following MI factory function(s) returned an error:
_Generic_Create_InstanceMI, message was: Traceback (most recent call
last):
File "/usr/lib/python2.7/site-packages/cmpi_pywbem_bindings.py", line
446, in get_cmpi_proxy_provider
prox = ExceptionClassWrapper(CMPIProxyProvider(miname, broker, ctx))
File "/usr/lib/python2.7/site-packages/cmpi_pywbem_bindings.py", line
463, in _init_
self.proxy = ProviderProxy(env, provmod)
File "/usr/lib/python2.7/site-packages/pywbem/cim_provider2.py", line
1670, in_init_
self._load_provider_source(logger)
File "/usr/lib/python2.7/site-packages/pywbem/cim_provider2.py", line
1694, in _load_provider_source
fn = imp.find_module(self.provider_module_name, [provdir])
ImportError: No module named TUT_UnixProcess
It seems you don't have TUT_UnixProcess.py on the right place.
As written in
https://fedorahosted.org/openlmi/wiki/ProviderTutorialImplementationPytho...,
it should be installed in /usr/lib/python2.7/site-packages/tutorial (or
whatever your Python site directory is) and appropriate .reg file should
refer it with full path:
[TUT_UnixProcess]
provider: /usr/lib/python2.7/site-packages/tutorial/TUT_UnixProcess.py
location: pyCmpiProvider
type: instance method
namespace: root/cimv2
If something goes wrong, you can debug/troubleshoot the provider loading
in /usr/lib/python2.7/site-packages/pywbem/cim_provider2.py - just add
following code before imp.find_module() call:
print >>sys.stderr, self.provider_module_name, provider
and run Pegasus with using this command:
$ cimserver daemon=false forceProviderProcesses=false
All 'print' will go to stderr, as described in Debugging chapter in the
tutorial.
Jan