Bug 818579

Summary: Error parsing NULL properties in Python provider
Product: [Fedora] Fedora Reporter: Jan Safranek <jsafrane>
Component: cmpi-bindingsAssignee: Jan Safranek <jsafrane>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: jsafrane, vcrhonek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cmpi-bindings-0.5.2-1.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-07 10:36:11 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
(highly) experimental patch none

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