提交 2432383e 编写于 作者: P Praveen K Pandey

fixed avocado:core:sysinfo as crash issue

avocado crashed if user provide non exsting profiler
this patch address that , if profiler not avilable than
framework  handle gracefully handle
Signed-off-by: NPraveen K Pandey <praveen@linux.vnet.ibm.com>
上级 0d2f2916
......@@ -206,24 +206,29 @@ class Daemon(Command):
logf_path = os.path.join(logdir, self.logf)
stdin = open(os.devnull, "r")
stdout = open(logf_path, "w")
self.daemon_process = subprocess.Popen(shlex.split(self.cmd),
stdin=stdin, stdout=stdout,
stderr=subprocess.STDOUT,
shell=False, env=env)
try:
self.daemon_process = subprocess.Popen(shlex.split(self.cmd),
stdin=stdin, stdout=stdout,
stderr=subprocess.STDOUT,
shell=False, env=env)
except OSError:
log.debug("Not logging %s (command could not be run)" % self.cmd)
def stop(self):
"""
Stop daemon execution.
"""
retcode = self.daemon_process.poll()
if retcode is None:
process.kill_process_tree(self.daemon_process.pid)
retcode = self.daemon_process.wait()
else:
log.error("Daemon process '%s' (pid %d) "
"terminated abnormally (code %d)",
self.cmd, self.daemon_process.pid, retcode)
return retcode
if self.daemon_process is not None:
retcode = self.daemon_process.poll()
if retcode is None:
process.kill_process_tree(self.daemon_process.pid)
retcode = self.daemon_process.wait()
else:
log.error("Daemon process '%s' (pid %d) "
"terminated abnormally (code %d)",
self.cmd, self.daemon_process.pid, retcode)
return retcode
class JournalctlWatcher(Collectible):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册