当前位置: 首页>>代码示例>>Python>>正文


Python EEService.get_service_status方法代码示例

本文整理汇总了Python中ee.core.services.EEService.get_service_status方法的典型用法代码示例。如果您正苦于以下问题:Python EEService.get_service_status方法的具体用法?Python EEService.get_service_status怎么用?Python EEService.get_service_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ee.core.services.EEService的用法示例。


在下文中一共展示了EEService.get_service_status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: status

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import get_service_status [as 别名]
 def status(self):
     """Status of services"""
     services = []
     if self.app.pargs.nginx:
         Log.debug(self, "nginx service status")
         services = services + ['nginx']
     if self.app.pargs.php:
         Log.debug(self, "php5-fpm service status")
         services = services + ['php5-fpm']
     if self.app.pargs.mysql:
         if EEVariables.ee_mysql_host is "localhost":
             Log.debug(self, "mysql service status")
             services = services + ['mysql']
         else:
             Log.warn(self, "Remote MySQL found, "
                      "unable to get MySQL service status")
     if self.app.pargs.postfix:
         services = services + ['postfix']
         Log.debug(self, "postfix service status")
     if self.app.pargs.memcache:
         Log.debug(self, "memcached service status")
         services = services + ['memcached']
     if self.app.pargs.dovecot:
         Log.debug(self, "dovecot service status")
         services = services + ['dovecot']
     if not services and EEVariables.ee_mysql_host is "localhost":
         services = services + ['nginx', 'php5-fpm', 'mysql', 'postfix']
         Log.debug(self, "nginx,php5-fpm,mysql,postfix services status")
     elif not services:
         services = services + ['nginx', 'php5-fpm', 'postfix']
         Log.debug(self, "nginx,php5-fpm,postfix services status")
     for service in services:
         if EEService.get_service_status(self, service):
             Log.info(self, "{0:10}:  {1}".format(service, "Running"))
开发者ID:rahul286,项目名称:easyengine,代码行数:36,代码来源:stack_services.py

示例2: status

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import get_service_status [as 别名]
    def status(self):
        """Status of services"""
        services = []
        if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
                or self.app.pargs.mysql or self.app.pargs.postfix
                or self.app.pargs.hhvm or self.app.pargs.memcache
                or self.app.pargs.dovecot or self.app.pargs.redis):
            self.app.pargs.nginx = True
            self.app.pargs.php = True
            self.app.pargs.mysql = True
            self.app.pargs.postfix = True
            self.app.pargs.hhvm = True

        if self.app.pargs.nginx:
            if EEAptGet.is_installed(self, 'nginx-custom') or EEAptGet.is_installed(self,'nginx-mainline'):
                services = services + ['nginx']
            else:
                Log.info(self, "Nginx is not installed")

        if self.app.pargs.php:
            if EEVariables.ee_platform_codename != 'trusty':
                if EEAptGet.is_installed(self, 'php5-fpm'):
                    services = services + ['php5-fpm']
                else:
                    Log.info(self, "PHP5-FPM is not installed")
            else:
                if EEAptGet.is_installed(self, 'php5.6-fpm'):
                    services = services + ['php5.6-fpm']
                else:
                    Log.info(self, "PHP5.6-FPM is not installed")

                if EEAptGet.is_installed(self, 'php7.0-fpm'):
                    services = services + ['php7.0-fpm']
                else:
                    Log.info(self, "PHP7.0-FPM is not installed")

        if self.app.pargs.php7:
            if EEVariables.ee_platform_codename == 'trusty':
                if EEAptGet.is_installed(self, 'php7.0-fpm'):
                    services = services + ['php7.0-fpm']
                else:
                    Log.info(self, "PHP7.0-FPM is not installed")
            else:
                Log.info(self, "Your platform does not support PHP 7")

        if self.app.pargs.mysql:
            if ((EEVariables.ee_mysql_host is "localhost") or
               (EEVariables.ee_mysql_host is "127.0.0.1")):
                if (EEAptGet.is_installed(self, 'mysql-server') or
                   EEAptGet.is_installed(self, 'percona-server-server-5.6') or
                   EEAptGet.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.postfix:
            if EEAptGet.is_installed(self, 'postfix'):
                services = services + ['postfix']
            else:
                Log.info(self, "Postfix is not installed")

        if self.app.pargs.hhvm:
            if EEAptGet.is_installed(self, 'hhvm'):
                services = services + ['hhvm']
            else:
                Log.info(self, "HHVM is not installed")
        if self.app.pargs.memcache:
            if EEAptGet.is_installed(self, 'memcached'):
                services = services + ['memcached']
            else:
                Log.info(self, "Memcache is not installed")

        if self.app.pargs.dovecot:
            if EEAptGet.is_installed(self, 'dovecot-core'):
                services = services + ['dovecot']
            else:
                Log.info(self, "Mail server is not installed")

        if self.app.pargs.redis:
            if EEAptGet.is_installed(self, 'redis-server'):
                services = services + ['redis-server']
            else:
                Log.info(self, "Redis server is not installed")

        for service in services:
            if EEService.get_service_status(self, service):
                Log.info(self, "{0:10}:  {1}".format(service, "Running"))
开发者ID:MansoorMajeed,项目名称:easyengine,代码行数:92,代码来源:stack_services.py


注:本文中的ee.core.services.EEService.get_service_status方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。