fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] fab version


From: Kaushal Shriyan
Subject: Re: [Fab-user] fab version
Date: Mon, 24 Oct 2011 11:29:06 +0530

On Mon, Oct 24, 2011 at 5:40 AM, Ronan Amicel <address@hidden> wrote:
> On Mon, Oct 24, 2011 at 01:35, Kaushal Shriyan <address@hidden> wrote:
>>
>> Am i missing something ?
>
> Here are a few tips, to help you get running with fabric.
>
> If you want to know which version of fabric is installed:
>
> $ fab --version
>
> If you want to launch the "install" task defined in your fabfile:
>
> $ fab install
>
> If you want fabric to tell you what tasks are defined in the fabfile:
>
> $ fab -l
>
> If you have not done so already, I recommend reading the fabric tutorial here:
> http://docs.fabfile.org/en/1.3.0/tutorial.html
>
> Hope this helps.
>
> --
> Ronan Amicel
>

Thanks Ronan Amicel it worked.

I have the below

#!/usr/bin/env python
from fabric.api import *
env.shell = '/bin/bash -l -c'
out_log = open("output.txt", "w")
with open("hosts.txt") as host_file:
        host_list = [x.strip() for x in host_file.readlines()]

@hosts(host_list)
def route():
        with settings(warn_only=True):
            checkroute = run("route -n").stderr
        out_log.write("%s: %s" % (env.host, checkroute))

When i run the command fab route i dont see the output getting
populated on output.txt, instead i just see IP's as mentioned in
hosts.txt

cat output.txt
10.0.0.101: 10.0.0.102: 10.0.0.103:

Am i missing anything

Regards

Kaushal



reply via email to

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