You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I cronjob a fabric task towards multiple hosts (-H ) and one of them has e.g. changed password, the session hangs, asking for a password. If I set the "abort_on_prompts", the session exits instead, and the rest of nodes in the role are never tasked.
So I'm needing something like a "skip_on_prompts" for my fully automated fabfile.
Can I make up this behaviour somehow? I tried setting env.abort_on_prompts=True, then wrapping into a warn_only=True, but the abort proceeds anyway.
Or, put in another way, warn_only=True should take precedence over abort_on_prompts=True.
The text was updated successfully, but these errors were encountered:
Ok, so I just found a workaround for this by catching the abort exception;
with settings(user=host_user, password=host_password, abort_on_prompts=True):
# Try to SSH into the node and run a simple command
try:
run('pwd')
except SystemExit, e:
print 'SSH login into %s failed!' % env.host
else:
print 'SSH login into %s was ok' % env.host
Hello Experts, I am newbie into the fabric, i have the same problem "password prompt" if it has wrong password, How i can customise by below fab file..
import sys
from fabric.api import *
env.skip_bad_hosts=True
env.command_timeout=160
env.user = 'user1'
env.shell = "/bin/sh -c"
env.warn_only = True
env.abort_on_prompts = True
env.password = 'pass123'
def readH():
env.hosts = [line.strip() for line in sys.stdin.readlines()]
def cpam():
with settings(warn_only=True):
output=sudo("/grid/it/bin/cyberAddHost.sh",shell=False)
If I cronjob a fabric task towards multiple hosts (-H ) and one of them has e.g. changed password, the session hangs, asking for a password. If I set the "abort_on_prompts", the session exits instead, and the rest of nodes in the role are never tasked.
So I'm needing something like a "skip_on_prompts" for my fully automated fabfile.
Can I make up this behaviour somehow? I tried setting env.abort_on_prompts=True, then wrapping into a warn_only=True, but the abort proceeds anyway.
Or, put in another way, warn_only=True should take precedence over abort_on_prompts=True.
The text was updated successfully, but these errors were encountered: