[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fab-user] fab java_version
From: |
Kaushal Shriyan |
Subject: |
[Fab-user] fab java_version |
Date: |
Wed, 1 Jun 2011 08:45:45 +0530 |
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fab-user] fab java_version,
Kaushal Shriyan <=