Bug 808124

Summary: Infinite recursion when calling non-existent method
Product: [Retired] oVirt Reporter: Martina Kollarova <mkollaro>
Component: ovirt-engine-sdkAssignee: Michael Pasternak <mpastern>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: acathrow, bazulay, dyasny, iheim, ncredi, oramraz, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-17 07:48:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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.