Skip to content

Commit f34bb11

Browse files
committed
modified: README.md
modified: picostack/process_spawn.py modified: picostack/vm_manager.py - Corrected spelling in documentation and logging messages.
1 parent 63fdd19 commit f34bb11

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ cd picostack
7878
pip install -e .
7979
```
8080

81-
or just give it a try your luck and directly pick a PyPI package:
81+
or just try your luck by directly picking a PyPI package:
8282

8383
```bash
8484
pip install picostack

picostack/process_spawn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def kill_process(cls, pidfile_path):
254254
return False
255255
pid = int(open(pidfile_path).read())
256256
if not ProcessUtil.process_runs(pidfile_path):
257-
logger.warn('Proccess was not found %d' % pid)
257+
logger.warn('Process was not found %d' % pid)
258258
return False
259259
# SIGTERM is handled by DaemonContext
260260
os.kill(pid, signal.SIGTERM)

picostack/vm_manager.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ def get_kvm_call(self, machine):
253253
'host_vnc': host_vnc,
254254
}) + ' '.join([redirected_ports, host_vnc])
255255

256-
257256
def run_machine(self, machine):
258257
# Check if machine is in accepting state.
259258
assert machine.current_state == VM_IS_LAUNCHED
@@ -263,7 +262,12 @@ def run_machine(self, machine):
263262
#output = invoke(command)
264263
report_filepath = self.get_report_file(machine)
265264
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
267271
ProcessUtil.exec_process(shell_command, report_filepath, pid_filepath)
268272
# Update state.
269273
machine.change_state(VM_IS_RUNNING)
@@ -277,7 +281,7 @@ def stop_machine(self, machine):
277281
# First kill proc which is a child and then daemoncxt.
278282
if ProcessUtil.kill_process(proc_pidfile_path) \
279283
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' %
281285
(proc_pidfile_path, cxt_pidfile_filepath))
282286
# Proc pid should be taken care of.
283287
if os.path.exists(proc_pidfile_path):

0 commit comments

Comments
 (0)