[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fab-user] Re: About Interaction with remote programs
From: |
Mohamed Lrhazi |
Subject: |
[Fab-user] Re: About Interaction with remote programs |
Date: |
Fri, 1 Apr 2011 22:38:26 -0400 |
I figured a dirty fix to my issue, how to intercept a couple of
different kinds of password prompts. I hacked io.py as follows:
def output_loop(chan, which, capture):
...
# Handle prompts
import re
#prompt = _endswith(capture, env.sudo_prompt)
SUDO_PROMPT_PATTERN=re.compile("""[Pp]assword( for [\w]+)?\:""")
KSU_PROMPT_PATTERN=re.compile("""Kerberos password for
([\S]+): :""")
prompt=False
for p in [SUDO_PROMPT_PATTERN,KSU_PROMPT_PATTERN]:
result=p.search("".join(capture))
if result:
prompt=True
env.sudo_prompt=result.group()
break
On Fri, Apr 1, 2011 at 8:58 PM, Mohamed Lrhazi <address@hidden> wrote:
> The chapter "Interaction with remote programs" of the manual talks
> about the user interacting with remote programs, how can one do that
> programatically?
> Specifically, how do I detect that a remote program is expecting some
> input, like a password, and be able to send it to it?
>
> Thanks a lot
> Mohamed.
>