|
From: | Chris Henry |
Subject: | [Fab-user] warn_only with fatal host errors |
Date: | Fri, 29 Jul 2011 17:50:08 -0700 |
So far with all of my fabric code I’ve been able to wrap any everything I didn’t want to end my script via: with settings(warn_only=True): do pythonic something here however this seems to still fail and not purely warn if it is unable to connect to a host. Ie: No route to host, invalid DNS name, etc. Is there any way to keep fabric from exiting out on this and letting me continue? Not of the other settings in env seem to be related to exit behavior Examples: Invalid hostname: In [12]: env['host_string']='someinvalidhost.mydomain.blah' In [13]: with settings(warn_only=True): run("ls") ....: ....: [someinvalidhost.mydomain.blah] run: ls Fatal error: Name lookup failed for someinvalidhost.mydomain.blah Aborting. --------------------------------------------------------------------------- SystemExit Traceback (most recent call last) No Route to host: In [18]: env['host_string']='10.1.1.1' In [19]: with settings(warn_only=True): run("help") ....: ....: [10.21.1.200] run: help Fatal error: Low level socket error connecting to host 10.21.1.200: No route to host Aborting. --------------------------------------------------------------------------- SystemExit Traceback (most recent call last) -Chris H
|
[Prev in Thread] | Current Thread | [Next in Thread] |