Bug 818579 - Error parsing NULL properties in Python provider
Summary: Error parsing NULL properties in Python provider
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cmpi-bindings
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Jan Safranek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-03 12:35 UTC by Jan Safranek
Modified: 2012-05-07 10:36 UTC (History)
2 users (show)

Fixed In Version: cmpi-bindings-0.5.2-1.fc18
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-07 10:36:11 UTC
Type: Bug
Embargoed:


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

Description Jan Safranek 2012-05-03 12:35:23 UTC
Description of problem:
I have a simple CIM provider written using pywbem + cmpi-bindings and I
get traceback when it parses xml with NULL values, for example when
processing ModifyInstance:

<CIM CIMVERSION="2.0" DTDVERSION="2.0">
  <MESSAGE ID="1001" PROTOCOLVERSION="1.0">
    <SIMPLEREQ>
      <IMETHODCALL NAME="ModifyInstance">
        <LOCALNAMESPACEPATH>
          <NAMESPACE NAME="root"/>
          <NAMESPACE NAME="cimv2"/>
        </LOCALNAMESPACEPATH>
        <IPARAMVALUE NAME="ModifiedInstance">
...
           <PROPERTY NAME="InstallDate" TYPE="datetime"/>

Results into a traceback in cmpi2pywbem_inst():

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
492, in set_instance
    pinst = self.cmpi2pywbem_inst(newinst)
  File "/usr/lib/python2.7/site-packages/cmpi_pywbem_bindings.py", line
696, in cmpi2pywbem_inst
    _type, is_array = _cmpi_type2string(data.type)
AttributeError: 'NoneType' object has no attribute 'type'


The reason is that cmpiinst.get_property_at(i) returns data as None,
while cmpi2pywbem_inst expects that data.type exists.


Version-Release number of selected component (if applicable):
cmpi-bindings-pywbem-0.4.17-2

Comment 1 Jan Safranek 2012-05-03 12:53:58 UTC
Created attachment 581857 [details]
(highly) experimental patch

I've sent patch upstream for review, we don't have Perl and Ruby packaged in Fedora.

Comment 2 Jan Safranek 2012-05-07 10:36:11 UTC
Fixed by rebase to 0.5.2


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