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
评论列表
文章目录