Commit f060f056 authored by Boris Kocherov's avatar Boris Kocherov

fix start issue

parent 684ad8f3
......@@ -118,11 +118,14 @@ class Application(object):
self.start(init=False)
def status(self):
"""Check by socket if the openoffice work."""
pid = self.pid()
if pid is None or not pid_exists(pid):
return False
return True
"""Check daemon running."""
if hasattr(self, 'process'):
returncode = self.process.poll()
if returncode is None or returncode == 0:
return True
if pid_exists(self.process.pid):
return True
return False
def getAddress(self):
"""Return port and hostname of OOo Instance."""
......
......@@ -137,7 +137,8 @@ class OpenOffice(Application):
if waitStartDaemon(self, self.timeout - 1):
if self.last_test_error:
logger.debug(self.last_test_error)
break
return True
return False
def getConnection(self):
return self.connection
......@@ -179,9 +180,11 @@ class OpenOffice(Application):
env["HOME"] = self.path_user_installation
env["TMP"] = self.path_user_installation
env["TMPDIR"] = self.path_user_installation
self._startProcess(self.command, env)
self._cleanRequest()
Application.start(self)
if self._startProcess(self.command, env):
self._cleanRequest()
logger.debug("%s libreoffice PID: %s started", self.getConnection(), self.pid())
else:
logger.error("%s libreoffice not started", self.getConnection())
def stop(self, pid=None):
"""Stop the instance by pid. By the default
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment