提交 df85d15e 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!57 Fix pylint warnings of stop commands

Merge pull request !57 from liangyongxiong/master
...@@ -231,7 +231,7 @@ def start(): ...@@ -231,7 +231,7 @@ def start():
log_size = _get_file_size(errorlog_abspath) log_size = _get_file_size(errorlog_abspath)
stdout = setup_logger('mindinsight', 'stdout', console=True, logfile=False, formatter='%(message)s') console = setup_logger('mindinsight', 'console', console=True, logfile=False, formatter='%(message)s')
# start server # start server
process = subprocess.Popen( process = subprocess.Popen(
...@@ -243,15 +243,15 @@ def start(): ...@@ -243,15 +243,15 @@ def start():
) )
_, stderr = process.communicate() _, stderr = process.communicate()
if stderr: if stderr:
stdout.error(stderr.decode()) console.error(stderr.decode())
# wait command success to end when gunicorn running in daemon. # wait command success to end when gunicorn running in daemon.
if gunicorn_conf.daemon and process.wait() == 0: if gunicorn_conf.daemon and process.wait() == 0:
state_result = _check_server_start_stat(errorlog_abspath, log_size) state_result = _check_server_start_stat(errorlog_abspath, log_size)
# print gunicorn start state to stdout # print gunicorn start state to stdout
stdout.info('Web address: http://{}:{}'.format(settings.HOST, settings.PORT)) console.info('Web address: http://%s:%s', settings.HOST, settings.PORT)
for line in state_result["prompt_message"]: for line in state_result["prompt_message"]:
stdout.info(line) console.info(line)
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -109,7 +109,7 @@ class Command(BaseCommand): ...@@ -109,7 +109,7 @@ class Command(BaseCommand):
try: try:
os.kill(pid, signal.SIGKILL) os.kill(pid, signal.SIGKILL)
except PermissionError: except PermissionError:
self.console.info('kill pid %s failed due to permission error' % pid) self.console.info('kill pid %s failed due to permission error', pid)
sys.exit(1) sys.exit(1)
# cleanup gunicorn worker processes # cleanup gunicorn worker processes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册