Bug 808124 - Infinite recursion when calling non-existent method
Summary: Infinite recursion when calling non-existent method
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-sdk
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Michael Pasternak
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-29 16:10 UTC by Martina Kollarova
Modified: 2014-10-07 00:16 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-17 07:48:49 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)

Description Martina Kollarova 2012-03-29 16:10:43 UTC
Description of problem:
Calling a non-existent method causes the program to go into infinite recursion and exit with the error:

RuntimeError: maximum recursion depth exceeded while calling a Python object

Another examples are: 
api.vms.foo()
api.vms.get(NAME).snapshots.foo()
api.clusters.bar()

Version-Release number of selected component (if applicable):
Tried out in version 1.3 (release 1.fc16) and on recent git commit f538a42c0 (release 1.6.3-1).

How reproducible:
always

Steps to Reproduce:
1. call api.datacenters.foo()

  
Actual results:
RuntimeError: maximum recursion depth exceeded while calling a Python object

Expected results:
AttributeError

Additional info:
This is how the traceback looks like when calling api.datacenters.foo():

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/mkollaro/Projects/test-ovirt-engine-sdk/tests/test_storage.py", line 37, in test_x
    api.datacenters.foo()
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/common.py", line 29, in __getattr__
  ...
  ...
    return self.superclass.__getattribute__(item)
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/common.py", line 29, in __getattr__
    return self.superclass.__getattribute__(item)
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/common.py", line 29, in __getattr__
    return self.superclass.__getattribute__(item)
RuntimeError: maximum recursion depth exceeded

Comment 1 Michael Pasternak 2012-04-03 07:29:30 UTC
fixed in 1.6.5-1

Comment 2 Martina Kollarova 2012-04-03 08:02:05 UTC
Patch correctly raises AttributeError for all examples given, didn't find a way to break it. Did not create any regressions in my tests.


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