diff --git a/noseapp_daemon/runner.py b/noseapp_daemon/runner.py index 345b13c..193e9ba 100644 --- a/noseapp_daemon/runner.py +++ b/noseapp_daemon/runner.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import logging - import psutil from noseapp_daemon import utils @@ -101,6 +100,16 @@ def cmd(self): 'Property "cmd" should be implemented in subclasses.', ) + @property + def cmd_with_prefix(self): + result = '' + + if self.cmd_prefix: + result += self.cmd_prefix + ' ' + result += self.cmd + + return result + @property def started(self): return bool(self.process) or self.pid_file.exist @@ -123,13 +132,7 @@ def start(self): self.before_start() - cmd = [] - - if self.cmd_prefix: - cmd.append(self.cmd_prefix) - - cmd += self.cmd - cmd = ' '.join(cmd) + cmd = self.cmd_with_prefix process_options = self.process_options.copy()