On Mon, Oct 24, 2011 at 5:40 AM, Ronan Amicel <[email protected]> wrote:
> On Mon, Oct 24, 2011 at 01:35, Kaushal Shriyan <[email protected]> 
> 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

_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to