fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Using execute appears to break ssh_config configuration


From: Brandon Whaley
Subject: Re: [Fab-user] Using execute appears to break ssh_config configuration
Date: Tue, 19 Aug 2014 11:24:31 -0400

Hi Matthias,

How are you loading the contents of __init__.py?  I don't see any
module imports in your test.py file.  I would generally put what you
have there directly in the fabfile itself, right after the fabric.api
import.

On Tue, Aug 19, 2014 at 11:21 AM, Matthias Witte
<address@hidden> wrote:
> Hi,
>
> I have a fabfile test.py like this
>
> ---------------------------------------------------------------------
> from fabric.api import *
>
> env.hosts = ['foo.bar.baz', 'boo.bar.baz']
>
> @task
> def simple():
>     run("uname -a")
>
> @task
> @runs_once
> def simple_go():
>     execute(simple)
>
> @task
> def simple_gogo():
>     execute(simple)
> ---------------------------------------------------------------------
>
> __init__.py contains
>
> ---------------------------------------------------------------------
> env.ssh_config_path = os.path.expanduser("~/.ssh/config.fab")
> env.use_ssh_config = True
> ---------------------------------------------------------------------
>
> where config.fab looks like this
>
> ---------------------------------------------------------------------
> Host foo.bar.baz
> Hostname 10.1.2.3
>
> Host boo.bar.baz
> Hostname 10.1.2.4
>
> Host foo.*
> User root
>
> Host *.baz
> User ubuntu
> ---------------------------------------------------------------------
>
> i.e. hosts named foo.* require login as root, everything else as ubuntu.
>
> If I run
>
> fab test.simple
>
> everything works as expected, that is the script logs into foo as root
> and into boo as
> user ubuntu.
>
> If I try this with the workhorse pattern
>
> fab test.simple_go
>
> or even without the @runs_once decorator
>
> fab test.simple_gogo
>
> it succeeds to log into foo as root, but then tries to log into boo as
> well as root.
>
> Is this the intended if somewhat unexpected behaviour of execute or
> have I hit on a bug?
>
> paramiko as well as ssh and parallel-ssh work fine with the given
> ssh_config so the problem
> is unlikely due to incorrect ssh_config parsing. Only using execute
> triggers this behaviour.
>
> I am willing to extend my debugging foo, but would like to be sure
> this is a real bug and not
> me doing something I should not be doing.
>
> Kind regards,
>
> Matthias
>
> --
> Matthias Witte
> Email: address@hidden
>
> _______________________________________________
> 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]