Blob Blame History Raw
commit 1bcb2eab54783cec8845a9ed3f81cfa8728503af
Author: Jan Safranek <jsafrane@redhat.com>
Date:   Thu Feb 14 17:59:29 2013 +0100

    Fixed returning NULL arrays to CIMOM.
    
    Pegasus is especially sensitive about this and reports:
    
    CIM_ERR_FAILED: Traceback (most recent call last):
      File /usr/lib/python2.7/site-packages/cmpi_pywbem_bindings.py, line 82, in __call__
        return self.meth(*args, **kwds)
      File /usr/lib/python2.7/site-packages/cmpi_pywbem_bindings.py, line 514, in get_instance
        cinst = self.pywbem2cmpi_inst(pinst)
      File /usr/lib/python2.7/site-packages/cmpi_pywbem_bindings.py, line 792, in pywbem2cmpi_inst
        cinst.set_property(str(prop.name), data, ctype)
      File /usr/lib/python2.7/site-packages/cmpi.py, line 831, in set_property
        return _cmpi.CMPIInstance_set_property(self, *args)
    CIMError: (1, '61')

diff --git a/swig/python/cmpi_pywbem_bindings.py b/swig/python/cmpi_pywbem_bindings.py
index 0368ab2..b1d9b32 100644
--- a/swig/python/cmpi_pywbem_bindings.py
+++ b/swig/python/cmpi_pywbem_bindings.py
@@ -787,7 +787,7 @@ class CMPIProxyProvider(object):
             except TypeError, te:
                 raise TypeError('Error converting Property %s: Value %s, Type %s; %s' % (prop.name, prop.value, prop.type, str(te)))
             ctype = _pywbem2cmpi_typemap[_type]
-            if isinstance(prop.value, list):
+            if isinstance(prop.value, list) or prop.is_array:
                 ctype = ctype | cmpi.CMPI_ARRAY
             cinst.set_property(str(prop.name), data, ctype)
         return cinst