Discussion:
[Fab-user] skip "No route to host"
t***@bluewin.ch
2014-04-06 09:25:48 UTC
Permalink
Hi all,

how can I avoid or skip "Fatal error: Low level socket error connecting to host xyz: No route to host" when one host is down / not reachable ?


e.g.

from fabric.api import env,sudo,roles,run,task,cd

env.roledefs = {
'lamp':['www','www-b','www-f'],
}

def updatenupgrade():
if run("lsb_release -i| egrep -i '(Debian|Ubuntu)'"):
sudo('aptitude update && aptitude upgrade')
else:
sudo('yum update')





If host 'www-b' is down 'www-f' unfortunately never gets treated.

(--warn-only does not help)


thanks,


Jan
Jeff Forcier
2014-04-06 18:04:50 UTC
Permalink
Try http://docs.fabfile.org/en/1.8/usage/env.html#skip-bad-hosts ?
Post by t***@bluewin.ch
Hi all,
how can I avoid or skip "Fatal error: Low level socket error connecting to host xyz: No route to host" when one host is down / not reachable ?
e.g.
from fabric.api import env,sudo,roles,run,task,cd
env.roledefs = {
'lamp':['www','www-b','www-f'],
}
sudo('aptitude update && aptitude upgrade')
sudo('yum update')
If host 'www-b' is down 'www-f' unfortunately never gets treated.
(--warn-only does not help)
thanks,
Jan
_______________________________________________
Fab-user mailing list
https://lists.nongnu.org/mailman/listinfo/fab-user
--
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org
t***@bluewin.ch
2014-04-06 19:02:09 UTC
Permalink
Great Jeff --skip-bad-hosts works perfectly

$ fab -V
Fabric 1.8.3
Paramiko 1.12.3

I had Fabric 1.3.2 before.


Thanks a lot !


----Message d'origine----
De : ***@bitprophet.org
Date : 06/04/2014 - 20:04 (CEST)
A : ***@bluewin.ch
Cc : fab-***@nongnu.org
Objet : Re: [Fab-user] skip "No route to host"

Try http://docs.fabfile.org/en/1.8/usage/env.html#skip-bad-hosts ?
Post by t***@bluewin.ch
Hi all,
how can I avoid or skip "Fatal error: Low level socket error connecting to host xyz: No route to host" when one host is down / not reachable ?
e.g.
from fabric.api import env,sudo,roles,run,task,cd
env.roledefs = {
'lamp':['www','www-b','www-f'],
}
sudo('aptitude update && aptitude upgrade')
sudo('yum update')
If host 'www-b' is down 'www-f' unfortunately never gets treated.
(--warn-only does not help)
thanks,
Jan
_______________________________________________
Fab-user mailing list
https://lists.nongnu.org/mailman/listinfo/fab-user
--
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org
Loading...