Bug 883041 - Cannot return NULL array from get_instance
Summary: Cannot return NULL array from get_instance
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cmpi-bindings
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Vitezslav Crhonek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-03 16:53 UTC by Jan Safranek
Modified: 2013-02-21 05:53 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-02-21 05:53:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Experimental patch (2.19 KB, patch)
2012-12-03 16:53 UTC, Jan Safranek
no flags Details | Diff

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.


Note You need to log in before you can comment on or make changes to this bug.