fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] Error handling with @parallel decorator


From: Ankur Agrawal
Subject: [Fab-user] Error handling with @parallel decorator
Date: Sat, 16 Jan 2016 00:58:48 +0000

I am trying to catch Abort exception. When I use fabric run(...) method, the host it tries to connect is not available and so it aborts with connect time out exception. I am not able to catch it. Following is a two different ways of code snippet-
First I try following  - 
class FabricException(Exception):
pass
with settings(abort_exception = FabricException):
try:
output = run(command)
except FabricException:
print 'inside exception'
LOG.debug("inside exception")
It didn't go in exception block. Instead it threw -
NetworkError: Timed out trying to connect to pqaltsnas300.corp.intuit.net (tried 1 time)
Aborting.
SystemExit: 1

Then I try to continue even if exception - 
command  = 'ls -l'
with settings(warn_only = True):
      output = run(command)

Still it threw the same exception 
NetworkError: Timed out trying to connect to pqaltsnas300.corp.intuit.net (tried 1 time)
Aborting.
SystemExit: 1

Appreciate if somebody tell if I am missing anything ?

Thanks,
Ankur



reply via email to

[Prev in Thread] Current Thread [Next in Thread]