fab-user
[Top][All Lists]
Advanced

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

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


From: Morgan Goose
Subject: Re: [Fab-user] Password prompt issues on parallel execution.
Date: Wed, 4 Apr 2012 09:43:25 -0700

Don't use interactive with parallel. Use ssh keys and or an ssh-agent.
No good things will come from that use case, as the parallel execution
aims at serving larger lists of hosts (100+).

-goose

On Wed, Apr 4, 2012 at 5:55 AM, Rohr, David <address@hidden> wrote:
> 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.
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fab-user
>



reply via email to

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