本文整理汇总了Python中sss.core.logging.Log.warn方法的典型用法代码示例。如果您正苦于以下问题:Python Log.warn方法的具体用法?Python Log.warn怎么用?Python Log.warn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sss.core.logging.Log
的用法示例。
在下文中一共展示了Log.warn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: stop
# 需要导入模块: from sss.core.logging import Log [as 别名]
# 或者: from sss.core.logging.Log import warn [as 别名]
def stop(self):
"""Stop services"""
services = []
if not (self.app.pargs.apache2 or self.app.pargs.php
or self.app.pargs.mysql or self.app.pargs.memcache):
self.app.pargs.apache2 = True
self.app.pargs.php = True
self.app.pargs.mysql = True
if self.app.pargs.apache2:
if SSSAptGet.is_installed(self,'apache2'):
services = services + ['apache2']
else:
Log.info(self,'Apache is not installed')
if self.app.pargs.php:
if SSSAptGet.is_installed(self, 'php7.0-fpm'):
services = services + ['php7.0-fpm']
else:
Log.info(self, "PHP7-FPM is not installed")
if self.app.pargs.mysql:
if ((SSSVariables.sss_mysql_host is "localhost") or
(SSSVariables.sss_mysql_host is "127.0.0.1")):
if (SSSAptGet.is_installed(self, 'mysql-server') or
SSSAptGet.is_installed(self, 'percona-server-server-5.6') or
SSSAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql']
else:
Log.info(self, "MySQL is not installed")
else:
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.memcache:
if SSSAptGet.is_installed(self, 'memcached'):
services = services + ['memcached']
else:
Log.info(self, "Memcache is not installed")
for service in services:
Log.debug(self, "Stopping service: {0}".format(service))
SSSService.stop_service(self, service)