I hope this helps.
On Wed, Jun 1, 2011 at 05:15, Kaushal Shriyan
<address@hidden> wrote:
Hi,
I have the below fabric script
#!/usr/bin/env python
from fabric.api import *
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 java_version():
with settings(warn_only=True):
version = run("java -version")
out_log.write("%s: %s" % (env.host, version))
address@hidden:~$ fab ^C
address@hidden:~$ fab java_version
[10.30.0.10] Executing task 'java_version'
[10.30.0.10] run: java -version
Password for address@hidden:
[10.30.0.10] err: java version "1.6.0_06"
[10.30.0.10] err: Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
[10.30.0.10] err: Java HotSpot(TM) 64-Bit Server VM (build 10.0-b22, mixed mode)
Done.
Disconnecting from 10.30.0.10... done.
address@hidden:~$ cat output.txt
10.30.0.10: address@hidden:~$
When i look at the output.txt i dont see the version name as against
the hostname. Please suggest/guide.
Regards,
Kaushal
_______________________________________________
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user
--
Venlig hilsen / Kind regards,
Christian Vest Hansen.