Bug 883041

Summary: Cannot return NULL array from get_instance
Product: [Fedora] Fedora Reporter: Jan Safranek <jsafrane>
Component: cmpi-bindingsAssignee: Vitezslav Crhonek <vcrhonek>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: jsafrane, vcrhonek
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 05:53:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Experimental patch none

Description Jan Safranek 2012-12-03 16:53:33 UTC
Created attachment 656832 [details]
Experimental patch

Description of problem:
I gave 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),

But 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')


Version-Release number of selected component (if applicable):
cmpi-bindings-pywbem-0.5.2-2.fc18.x86_64

Attached patch fixes the problem for me and the above code snippet starts working.

Comment 1 Jan Safranek 2012-12-20 08:59:10 UTC
Patch sent upstream: http://sourceforge.net/mailarchive/message.php?msg_id=30250539

Comment 2 Fedora Update System 2013-01-10 13:37:42 UTC
cmpi-bindings-0.5.2-3.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/cmpi-bindings-0.5.2-3.fc18

Comment 3 Fedora Update System 2013-01-10 21:28:37 UTC
Package cmpi-bindings-0.5.2-3.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing cmpi-bindings-0.5.2-3.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-0570/cmpi-bindings-0.5.2-3.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-01-23 02:09:57 UTC
cmpi-bindings-0.5.2-3.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Jan Safranek 2013-02-15 11:11:25 UTC
It's still not perfect, additional patch is needed:
https://github.com/jsafrane/cmpi-bindings/commit/1bcb2eab54783cec8845a9ed3f81cfa8728503af

(the patch was already merged upstream)

Comment 6 Fedora Update System 2013-02-15 14:05:11 UTC
cmpi-bindings-0.5.2-5.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/cmpi-bindings-0.5.2-5.fc18

Comment 7 Fedora Update System 2013-02-16 01:22:05 UTC
Package cmpi-bindings-0.5.2-5.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing cmpi-bindings-0.5.2-5.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-2565/cmpi-bindings-0.5.2-5.fc18
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2013-02-21 05:53:14 UTC
cmpi-bindings-0.5.2-5.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.