當前位置: 首頁>>代碼示例>>Python>>正文


Python Log.warn方法代碼示例

本文整理匯總了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)
開發者ID:harshiljethava,項目名稱:TestingSimpleSetupServer,代碼行數:45,代碼來源:stack_services.py


注:本文中的sss.core.logging.Log.warn方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。