supvisorsctl.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:supvisors 作者: julien6387 项目源码 文件源码
def _upcheck(self):
        """ Check of the API versions. """
        try:
            api = self.supvisors().get_api_version()
            if api != API_VERSION:
                self.ctl.output('ERROR: this version of supvisorsctl expects to talk to a server '
                    'with API version %s, but the remote version is %s.' % (API_VERSION, api))
                return False
        except xmlrpclib.Fault, e:
            if e.faultCode == xmlrpc.Faults.UNKNOWN_METHOD:
                self.ctl.output('ERROR: supervisord responded but did not recognize '
                    'the supvisors namespace commands that supvisorsctl uses to control it. '
                    'Please check that the [rpcinterface:supervisor] section is enabled '
                    'in the configuration file (see sample.conf).')
                return False
            raise
        except socket.error, why:
            if why.args[0] == errno.ECONNREFUSED:
                self.ctl.output('ERROR: %s refused connection' % self.ctl.options.serverurl)
                return False
            elif why.args[0] == errno.ENOENT:
                self.ctl.output('ERROR: %s no such file' % self.ctl.options.serverurl)
                return False
            raise
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号