fab-user
[Top][All Lists]
Advanced

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

[Fab-user] warn_only not applying to some errors


From: David Mcilwee
Subject: [Fab-user] warn_only not applying to some errors
Date: Fri, 6 Jan 2012 15:02:06 +0000

Hi all,

First off its for:
Fabric 1.3.1

which was obtained by pip from pypi


I'm making quite a few calls like:

with settings(warn_only=True):
        result = run("/some/command")

Now if there is a problem with connecting to the target I get the
following error message:


Fatal error: Low level socket error connecting to host xxx.xxx.xxx.xxx:
Connection refused

Aborting.



This boots me straight out as it calls sys.exit(1) and doesn't give the
calling function any indication of the actual error.

As this is all going on inside some automated scripts which never have
any manual intervention its causing some issues. 

The main thing is that I've no way of finding out that error text as its
printed directly to stderr. And that sys.exit(1) is being called
regardless of how the initial fabric calls are being invoked.



I've tracked this down to several of the low level connect methods in
fabric/networking.py calling abort() directly. ( connect(user, host,
port) when it throws an exception is the main example)

Is this by design? (Directly calling abort and hence sys.exit)

It'd be quite handy if I could specify that abort is to raise an
exception and not call sys.exit for use during completely automated
scripts


Thanks,
-- 
David Mcilwee
Software Engineer

Blacknight Solutions
Hosting, Co-location, Dedicated servers, Domains
IP Transit Services


IRL: 1850 929 929 / 059 9183072
US: 213-233-1612
UK: 0844 4849361
Intl. +353 59 9183072
Fax. +353 (0) 1 4811763

web: http://www.blacknight.com
blog: http://blog.blacknight.com

Blacknight Internet Solutions Ltd,
12A Barrowside Business Park,
Carlow,
Ireland

Registered in Ireland, Company No.: 370845






reply via email to

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