|
From: <np...@us...> - 2008-10-10 22:55:27
|
Revision: 1085
http://omc.svn.sourceforge.net/omc/?rev=1085&view=rev
Author: npaxton
Date: 2008-10-10 22:55:21 +0000 (Fri, 10 Oct 2008)
Log Message:
-----------
modify InvokeMethod to require a CIMInstanceName or CIMClassName, with namespace, or will fail... gets rid of TODO on default namespace
Modified Paths:
--------------
cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
===================================================================
--- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-10 21:18:59 UTC (rev 1084)
+++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-10 22:55:21 UTC (rev 1085)
@@ -298,21 +298,14 @@
yield piname
def InvokeMethod(self, path, method, **params):
- if isinstance(path, pywbem.StringTypes):
- # path is a String type: convert to CIMClassName
- objpath = pywbem.CIMClassName(path, namespace=ns)
- elif isinstance(path, pywbem.CIMInstanceName):
- if path.namespace is None:
- # TODO: Where does default namespace come from?
- # will likely either have to pass in a ns, or make
- # path always be an objectpath and not support just a
- # string for a classname (to creata a CIMClassName)
- ns = 'root/cimv2'
- path.namespace = ns
- objpath = path
- else:
- raise pywbem.CIMError(pywbem.CIM_INVALIDPARAMETER)
- cop = self.proxy.pywbem2cmpi_instname(objpath)
+ if not isinstance(path, pywbem.CIMClassName) and \
+ not isinstance(path, pywbem.CIMInstanceName):
+ # invalid parameter
+ raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_PARAMETER)
+ if path.namespace is None:
+ # must have namespace
+ raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_NAMESPACE)
+ cop = self.proxy.pywbem2cmpi_instname(path)
inargs=self.proxy.pywbem2cmpi_args(params)
poutargs = self.broker.new_args()
rc=self.broker.invokeMethod(self.ctx, cop, method, inargs, poutargs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|