fab-user
[Top][All Lists]
Advanced

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

[Fab-user] Password prompt issues on parallel execution.


From: Rohr, David
Subject: [Fab-user] Password prompt issues on parallel execution.
Date: Wed, 4 Apr 2012 13:55:05 +0100

Hey all.

 

I got a weird issue when setting up a  fabric  on some virtual centos environments. Not sure if this caused of a user error or some bug, but I seem to never get a password prompt trying to do stuff either in Parallel. If I specify a password, either with env.password or using the –p flag, everything works fine and dandy, but if no password is specified then everything crashes. Se examples bellow. I’ve tried with several hosts or just one host, same stuff happens.

 

Serial, I get a prompt, Parallel, I get an exception dump.

 

 

from fabric.api import *

 

@parallel

def testA():

    run('whoami')

 

def testB():

    run('whoami')

 

 

Running the testA example.

 

address@hidden ~]$ fab -H localhost testA

[localhost] Executing task 'testA'

[localhost] run: whoami

 

Fatal error: Needed to prompt for a connection or sudo password, but input would be ambiguous in parallel mode

 

Aborting.

!!! Parallel execution exception under host 'localhost':

Traceback (most recent call last):

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/tasks.py", line 167, in inner

    result = task.run(*args, **kwargs)

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/tasks.py", line 113, in run

    return self.wrapped(*args, **kwargs)

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/decorators.py", line 178, in inner

    return func(*args, **kwargs)

  File "/home/drohr/fabfile.py", line 5, in testA

    run('whoami')

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/network.py", line 457, in host_prompting_wrapper

    return func(*args, **kwargs)

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/operations.py", line 904, in run

    return _run_command(command, shell, pty, combine_stderr)

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/operations.py", line 814, in _run_command

    stdout, stderr, status = _execute(default_channel(), wrapped_command, pty,

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/state.py", line 340, in default_channel

    chan = connections[env.host_string].get_transport().open_session()

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/network.py", line 84, in __getitem__

    self.connect(key)

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/network.py", line 76, in connect

    self[key] = connect(user, host, port)

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/network.py", line 351, in connect

    password = prompt_for_password(text)

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/network.py", line 414, in prompt_for_password

    handle_prompt_abort("a connection or sudo password")

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/utils.py", line 138, in handle_prompt_abort

    abort(reason % "input would be ambiguous in parallel mode")

  File "/usr/lib/python2.6/site-packages/Fabric-1.4.0-py2.6.egg/fabric/utils.py", line 26, in abort

    sys.exit(1)

SystemExit: 1

 

Done.

 

 

Running the testB example.

 

address@hidden ~]$ fab -H localhost testB

[localhost] Executing task 'testB'

[localhost] run: whoami

[localhost] Passphrase for private key:

 

 

Any Ideas on what is causing this? Or is this the way you have to go? Maybe you have to specify the password when using Parallel execution?

 

 

/David.


reply via email to

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