kkaempf/cmpi-bindings — pull request #8 by jsafrane (2013-01-23 09:45:02+00:00)
Title: Fixed passing NULL array from get_instance

I have a python provider and I want to return an instance with NULL value of
string[] (or any other array) property.

Therefore I have in my get_instance method:
model['MyProperty'] = pywbem.CIMProperty(
name='MyProperty',
value=None,
type='string',
array_size=0,
is_array=True)

Under Pegasus CIMOM I get traceback, because Pegasus pedantically checks
property types;
File "/usr/lib/python2.7/site-packages/cmpi_pywbem_bindings.py", line 761, in pywbem2cmpi_inst
cinst.set_property(str(prop.name), data, ctype)
File "/usr/lib/python2.7/site-packages/cmpi.py", line 809, in set_property
return _cmpi.CMPIInstance_set_property(self, *args)
CIMError: (1, '61')

This patch adds two checks for NULL value of array and makes sure that the
CIMOM really gets NULL value of the property.