Merge "Wrap eventlet's Timeout exception"
This commit is contained in:
@@ -223,3 +223,11 @@ class EDPError(SaharaException):
|
||||
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
|
||||
|
||||
class TimeoutException(SaharaException):
|
||||
code = "TIMEOUT"
|
||||
message = "Operation timed out after %i second(s)"
|
||||
|
||||
def __init__(self, timeout):
|
||||
self.message = self.message % timeout
|
||||
|
||||
@@ -330,7 +330,7 @@ class InstanceInteropHelper(remote.Remote):
|
||||
def _run_with_log(self, func, timeout, *args, **kwargs):
|
||||
start_time = time.time()
|
||||
try:
|
||||
with e_timeout.Timeout(timeout):
|
||||
with e_timeout.Timeout(timeout, ex.TimeoutException(timeout)):
|
||||
return self._run(func, *args, **kwargs)
|
||||
finally:
|
||||
self._log_command('%s took %.1f seconds to complete' % (
|
||||
|
||||
Reference in New Issue
Block a user