Bug 818579 - Error parsing NULL properties in Python provider
Error parsing NULL properties in Python provider
Product: Fedora
Classification: Fedora
Component: cmpi-bindings (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Jan Safranek
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-05-03 08:35 EDT by Jan Safranek
Modified: 2012-05-07 06:36 EDT (History)
2 users (show)

See Also:
Fixed In Version: cmpi-bindings-0.5.2-1.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-05-07 06:36:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Jan Safranek 2012-05-03 08:35:23 EDT
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:

      <IMETHODCALL NAME="ModifyInstance">
          <NAMESPACE NAME="root"/>
          <NAMESPACE NAME="cimv2"/>
        <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):
Comment 1 Jan Safranek 2012-05-03 08:53:58 EDT
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 06:36:11 EDT
Fixed by rebase to 0.5.2

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