##// END OF EJS Templates
jobctrl: use shell for subprocess if trying without it fails
vivainio2 -
Show More
@@ -139,13 +139,25 b' def jobctrl_shellcmd(ip,cmd):'
139 else:
139 else:
140 use_shell = False
140 use_shell = False
141
141
142 jobentry = None
143 try:
144 try:
142 p = Popen(cmd,shell = use_shell)
145 p = Popen(cmd,shell = use_shell)
143 jobentry = 'tasks/t' + str(p.pid)
146 except WindowsError:
147 if use_shell:
148 # try with os.system
149 os.system(cmd)
150 return
151 else:
152 # have to go via shell, sucks
153 p = Popen(cmd,shell = True)
144
154
145 try:
155 jobentry = 'tasks/t' + str(p.pid)
146 ip.db[jobentry] = (p.pid,cmd,os.getcwd(),time.time())
156 ip.db[jobentry] = (p.pid,cmd,os.getcwd(),time.time())
147 p.communicate()
157 p.communicate()
158
148 finally:
159 finally:
160 if jobentry:
149 del ip.db[jobentry]
161 del ip.db[jobentry]
150
162
151
163
General Comments 0
You need to be logged in to leave comments. Login now