@@ -253,7 +253,6 @@ def get_kvm_call(self, machine):
253
253
'host_vnc' : host_vnc ,
254
254
}) + ' ' .join ([redirected_ports , host_vnc ])
255
255
256
-
257
256
def run_machine (self , machine ):
258
257
# Check if machine is in accepting state.
259
258
assert machine .current_state == VM_IS_LAUNCHED
@@ -263,7 +262,12 @@ def run_machine(self, machine):
263
262
#output = invoke(command)
264
263
report_filepath = self .get_report_file (machine )
265
264
pid_filepath = self .get_pid_file (machine )
266
- assert not ProcessUtil .process_runs (pid_filepath )
265
+ if ProcessUtil .process_runs (pid_filepath ):
266
+ logging .warning ('Apparently, VM process is already running. '
267
+ 'Check %s ' % pid_filepath )
268
+ machine .change_state (VM_HAS_FAILED )
269
+ # TODO: kill the VM?
270
+ return
267
271
ProcessUtil .exec_process (shell_command , report_filepath , pid_filepath )
268
272
# Update state.
269
273
machine .change_state (VM_IS_RUNNING )
@@ -277,7 +281,7 @@ def stop_machine(self, machine):
277
281
# First kill proc which is a child and then daemoncxt.
278
282
if ProcessUtil .kill_process (proc_pidfile_path ) \
279
283
and ProcessUtil .kill_process (cxt_pidfile_filepath ):
280
- logging .info ('Succefully stoping VM processes as in %s and %s' %
284
+ logging .info ('Successfully stopping VM processes as in %s and %s' %
281
285
(proc_pidfile_path , cxt_pidfile_filepath ))
282
286
# Proc pid should be taken care of.
283
287
if os .path .exists (proc_pidfile_path ):
0 commit comments