Bug 808124 - Infinite recursion when calling non-existent method
Infinite recursion when calling non-existent method
Status: CLOSED CURRENTRELEASE
Product: oVirt
Classification: Community
Component: ovirt-engine-sdk (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Michael Pasternak
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-29 12:10 EDT by Martina Kollarova
Modified: 2014-10-06 20:16 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-17 02:48:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martina Kollarova 2012-03-29 12:10:43 EDT
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 03:29:30 EDT
fixed in 1.6.5-1
Comment 2 Martina Kollarova 2012-04-03 04:02:05 EDT
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.