Bug 704227 - qmf-gen crashes if a schema does not contain statistics
Summary: qmf-gen crashes if a schema does not contain statistics
Keywords:
Status: CLOSED DUPLICATE of bug 692795
Alias: None
Product: Fedora
Classification: Fedora
Component: qpid-cpp
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nuno Santos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 704353
TreeView+ depends on / blocked
 
Reported: 2011-05-12 13:45 UTC by Andrew Beekhof
Modified: 2013-09-12 22:12 UTC (History)
4 users (show)

Fixed In Version: qpid-qmf-devel-0.10-2.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-17 18:34:27 UTC
Type: ---


Attachments (Terms of Use)
Patch (880 bytes, patch)
2011-05-12 14:37 UTC, Nuno Santos
no flags Details | Diff

Description Andrew Beekhof 2011-05-12 13:45:12 UTC
Description of problem:

qmf-gen crashes if a schema does not contain statistics 

Version-Release number of selected component (if applicable):

qpid-qmf-0.8-6

How reproducible:

Every time

Steps to Reproduce:
1. Save the following to schema.xml

<schema package="org.matahariproject">
  <class name="Network">
   <property name="hostname"         type="sstr"  access="RO" desc="Hostname" index="y" />
   <method name="list"          desc="List IP addresses">
     <arg name="iface_map"      dir="O"  type="list" />
   </method>
 </class>
</schema>

2. Run /usr/bin/qmf-gen -2 -o ./qmf schema.x
  
Actual results:

# /usr/bin/qmf-gen -2 -o ./qmf schema.xml
Traceback (most recent call last):
  File "/usr/bin/qmf-gen", line 80, in <module>
    gen.makeV2PackageFile("V2Package.cpp", package, vars=vargs)
  File "/usr/lib/python2.6/site-packages/qmfgen/generate.py", line 467, in makeV2PackageFile
    stream = template.expand (schema)
  File "/usr/lib/python2.6/site-packages/qmfgen/generate.py", line 100, in expand
    self.expandLine (line, stream, object)
  File "/usr/lib/python2.6/site-packages/qmfgen/generate.py", line 88, in expandLine
    self.handler.substHandler (object, stream, tagObject, tagName)
  File "/usr/lib/python2.6/site-packages/qmfgen/generate.py", line 392, in substHandler
    eval (call)
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/qmfgen/schema.py", line 1734, in genV2ClassDefines
    if stat.unit:
UnboundLocalError: local variable 'stat' referenced before assignment


Expected results:

Generated: qmf/org/matahariproject/QmfPackage.cpp

Additional info:

Comment 1 Nuno Santos 2011-05-12 14:37:33 UTC
Created attachment 498557 [details]
Patch

Comment 2 Nuno Santos 2011-05-17 18:34:27 UTC

*** This bug has been marked as a duplicate of bug 692795 ***


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