parent
912e365564
commit
b8b43a3317
@ -1642,6 +1642,8 @@ class SessionOrientedStub(StubAdapterBase):
|
||||
if isinstance(e, self.SESSION_EXCEPTIONS):
|
||||
# Our session might've timed out, change our state and retry.
|
||||
self._SetStateUnauthenticated()
|
||||
retriesLeft -= 1
|
||||
continue
|
||||
else:
|
||||
raise e
|
||||
return obj
|
||||
|
13
tests/test_vim_session_oriented_stub.py
Normal file
13
tests/test_vim_session_oriented_stub.py
Normal file
@ -0,0 +1,13 @@
|
||||
import tests
|
||||
|
||||
from pyVim import connect
|
||||
|
||||
|
||||
class SoapAdapterTests(tests.VCRTestBase):
|
||||
def test_invoke_method_login_session_exception(self):
|
||||
def login_fail(*args, **kwargs):
|
||||
raise vim_session.SESSION_EXCEPTIONS[0]()
|
||||
|
||||
stub = connect.SoapStubAdapter()
|
||||
vim_session = connect.VimSessionOrientedStub(stub, login_fail)
|
||||
self.assertRaises(SystemError, vim_session.InvokeAccessor, "mo", "info")
|
Loading…
x
Reference in New Issue
Block a user