Mercurial > repos > melissacline > ucsc_xena_platform
comparison runXena.py @ 30:77f5d8cbac77
add functionality to check the version of the current running xena server on the galaxy system
author | Jing Zhu <jzhu@soe.ucsc.edu> |
---|---|
date | Mon, 20 Jul 2015 13:31:33 -0700 |
parents | 14aaed60e07b |
children | bb84d3bc5308 |
comparison
equal
deleted
inserted
replaced
29:fc6f93710384 | 30:77f5d8cbac77 |
---|---|
4 | 4 |
5 #standard python libs | 5 #standard python libs |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import signal | 8 import signal |
9 import subprocess | 9 import subprocess, shlex |
10 import sys | 10 import sys |
11 import time | 11 import time |
12 import traceback | 12 import traceback |
13 import xena_utils as xena | 13 import xena_utils as xena |
14 | 14 |
114 if xenaIsRunning: | 114 if xenaIsRunning: |
115 fp.write("Terminating Xena VM on %s:%s\n" % (hostname, xenaPort)) | 115 fp.write("Terminating Xena VM on %s:%s\n" % (hostname, xenaPort)) |
116 else: | 116 else: |
117 fp.write("Xena VM is not currently running on %s\n" % (hostname)) | 117 fp.write("Xena VM is not currently running on %s\n" % (hostname)) |
118 | 118 |
119 elif sys.argv[1] == "version": | |
120 # check the current xena status | |
121 if xenaIsRunning: | |
122 xenaVersionCmd = "java -jar %s --version" % (xena.jarPath()) | |
123 args =shlex.split(xenaVersionCmd) | |
124 output, error = subprocess.Popen(args, stdout = subprocess.PIPE, stderr= subprocess.PIPE).communicate() | |
125 fp.write("The current Xena server version is %s\n" % (output)) | |
126 else: | |
127 fp.write("Xena Server is not currently running on %s, please start the server first, then you can check the server version.\n" % (hostname)) | |
119 else: | 128 else: |
120 fp.write(("Error: Unexpected command %s" % sys.argv[1])) | 129 fp.write(("Error: Unexpected command %s" % sys.argv[1])) |
121 | 130 |
122 | 131 |
123 # | 132 # |