move some error/warning to info so it's not printed in stderr by default. Fixes #5609
This commit is contained in:
parent
04db669265
commit
9d9ef1da89
|
@ -187,7 +187,7 @@ class SASL(PlugIn):
|
||||||
"""
|
"""
|
||||||
if not feats.getTag('mechanisms', namespace=NS_SASL):
|
if not feats.getTag('mechanisms', namespace=NS_SASL):
|
||||||
self.startsasl='not-supported'
|
self.startsasl='not-supported'
|
||||||
log.error('SASL not supported by server')
|
log.info('SASL not supported by server')
|
||||||
return
|
return
|
||||||
self.mecs = []
|
self.mecs = []
|
||||||
for mec in feats.getTag('mechanisms', namespace=NS_SASL).getTags(
|
for mec in feats.getTag('mechanisms', namespace=NS_SASL).getTags(
|
||||||
|
@ -245,7 +245,7 @@ class SASL(PlugIn):
|
||||||
self.startsasl = SASL_IN_PROCESS
|
self.startsasl = SASL_IN_PROCESS
|
||||||
raise NodeProcessed
|
raise NodeProcessed
|
||||||
self.startsasl = SASL_FAILURE
|
self.startsasl = SASL_FAILURE
|
||||||
log.error('I can only use EXTERNAL, DIGEST-MD5, GSSAPI and PLAIN '
|
log.info('I can only use EXTERNAL, DIGEST-MD5, GSSAPI and PLAIN '
|
||||||
'mecanisms.')
|
'mecanisms.')
|
||||||
if self.on_sasl:
|
if self.on_sasl:
|
||||||
self.on_sasl()
|
self.on_sasl()
|
||||||
|
@ -264,7 +264,7 @@ class SASL(PlugIn):
|
||||||
reason = challenge.getChildren()[0]
|
reason = challenge.getChildren()[0]
|
||||||
except Exception:
|
except Exception:
|
||||||
reason = challenge
|
reason = challenge
|
||||||
log.error('Failed SASL authentification: %s' % reason)
|
log.info('Failed SASL authentification: %s' % reason)
|
||||||
if len(self.mecs) > 0:
|
if len(self.mecs) > 0:
|
||||||
# There are other mechanisms to test
|
# There are other mechanisms to test
|
||||||
self.MechanismHandler()
|
self.MechanismHandler()
|
||||||
|
@ -340,7 +340,7 @@ class SASL(PlugIn):
|
||||||
self._owner.send(str(Node('response', attrs={'xmlns':NS_SASL})))
|
self._owner.send(str(Node('response', attrs={'xmlns':NS_SASL})))
|
||||||
else:
|
else:
|
||||||
self.startsasl = SASL_FAILURE
|
self.startsasl = SASL_FAILURE
|
||||||
log.error('Failed SASL authentification: unknown challenge')
|
log.info('Failed SASL authentification: unknown challenge')
|
||||||
if self.on_sasl:
|
if self.on_sasl:
|
||||||
self.on_sasl()
|
self.on_sasl()
|
||||||
raise NodeProcessed
|
raise NodeProcessed
|
||||||
|
@ -419,7 +419,7 @@ class NonBlockingNonSASL(PlugIn):
|
||||||
|
|
||||||
def _on_username(self, resp):
|
def _on_username(self, resp):
|
||||||
if not isResultNode(resp):
|
if not isResultNode(resp):
|
||||||
log.error('No result node arrived! Aborting...')
|
log.info('No result node arrived! Aborting...')
|
||||||
return self.on_auth(None)
|
return self.on_auth(None)
|
||||||
|
|
||||||
iq=Iq(typ='set', node=resp)
|
iq=Iq(typ='set', node=resp)
|
||||||
|
@ -450,7 +450,7 @@ class NonBlockingNonSASL(PlugIn):
|
||||||
query.setTagData('hash', hash_)
|
query.setTagData('hash', hash_)
|
||||||
self._method='0k'
|
self._method='0k'
|
||||||
else:
|
else:
|
||||||
log.warn("Sequre methods unsupported, performing plain text \
|
log.warn("Secure methods unsupported, performing plain text \
|
||||||
authentication")
|
authentication")
|
||||||
query.setTagData('password', self.password)
|
query.setTagData('password', self.password)
|
||||||
self._method = 'plain'
|
self._method = 'plain'
|
||||||
|
@ -464,7 +464,7 @@ class NonBlockingNonSASL(PlugIn):
|
||||||
self.owner._registered_name = self.owner.User+'@'+self.owner.Server+\
|
self.owner._registered_name = self.owner.User+'@'+self.owner.Server+\
|
||||||
'/'+self.owner.Resource
|
'/'+self.owner.Resource
|
||||||
return self.on_auth(self._method)
|
return self.on_auth(self._method)
|
||||||
log.error('Authentication failed!')
|
log.info('Authentication failed!')
|
||||||
return self.on_auth(None)
|
return self.on_auth(None)
|
||||||
|
|
||||||
|
|
||||||
|
@ -496,7 +496,7 @@ class NonBlockingBind(PlugIn):
|
||||||
attributes accordingly
|
attributes accordingly
|
||||||
"""
|
"""
|
||||||
if not feats.getTag('bind', namespace=NS_BIND):
|
if not feats.getTag('bind', namespace=NS_BIND):
|
||||||
log.error('Server does not requested binding.')
|
log.info('Server does not requested binding.')
|
||||||
# we try to bind resource anyway
|
# we try to bind resource anyway
|
||||||
#self.bound='failure'
|
#self.bound='failure'
|
||||||
self.bound = []
|
self.bound = []
|
||||||
|
@ -548,10 +548,10 @@ class NonBlockingBind(PlugIn):
|
||||||
func=self._on_session)
|
func=self._on_session)
|
||||||
return
|
return
|
||||||
if resp:
|
if resp:
|
||||||
log.error('Binding failed: %s.' % resp.getTag('error'))
|
log.info('Binding failed: %s.' % resp.getTag('error'))
|
||||||
self.on_bound(None)
|
self.on_bound(None)
|
||||||
else:
|
else:
|
||||||
log.error('Binding failed: timeout expired.')
|
log.info('Binding failed: timeout expired.')
|
||||||
self.on_bound(None)
|
self.on_bound(None)
|
||||||
|
|
||||||
def _on_session(self, resp):
|
def _on_session(self, resp):
|
||||||
|
|
|
@ -372,7 +372,7 @@ class NonBlockingClient:
|
||||||
# try to negotiate TLS
|
# try to negotiate TLS
|
||||||
if self.incoming_stream_version() != '1.0':
|
if self.incoming_stream_version() != '1.0':
|
||||||
# if stream version is less than 1.0, we can't do more
|
# if stream version is less than 1.0, we can't do more
|
||||||
log.warn('While connecting with type = "tls": stream version ' +
|
log.info('While connecting with type = "tls": stream version ' +
|
||||||
'is less than 1.0')
|
'is less than 1.0')
|
||||||
self._on_connect()
|
self._on_connect()
|
||||||
return
|
return
|
||||||
|
@ -382,7 +382,7 @@ class NonBlockingClient:
|
||||||
log.info('TLS supported by remote server. Requesting TLS start.')
|
log.info('TLS supported by remote server. Requesting TLS start.')
|
||||||
self._tls_negotiation_handler()
|
self._tls_negotiation_handler()
|
||||||
else:
|
else:
|
||||||
log.warn('While connecting with type = "tls": TLS unsupported ' +
|
log.info('While connecting with type = "tls": TLS unsupported ' +
|
||||||
'by remote server')
|
'by remote server')
|
||||||
self._on_connect()
|
self._on_connect()
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,7 @@ class NonBlockingTransport(PlugIn):
|
||||||
if hasattr(self, '_owner') and hasattr(self._owner, 'Dispatcher'):
|
if hasattr(self, '_owner') and hasattr(self._owner, 'Dispatcher'):
|
||||||
self.on_receive = self._owner.Dispatcher.ProcessNonBlocking
|
self.on_receive = self._owner.Dispatcher.ProcessNonBlocking
|
||||||
else:
|
else:
|
||||||
log.warning('No Dispatcher plugged. Received data will not be processed')
|
log.warn('No Dispatcher plugged. Received data will not be processed')
|
||||||
self.on_receive = None
|
self.on_receive = None
|
||||||
return
|
return
|
||||||
self.on_receive = recv_handler
|
self.on_receive = recv_handler
|
||||||
|
@ -453,7 +453,7 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
|
||||||
self._sock.shutdown(socket.SHUT_RDWR)
|
self._sock.shutdown(socket.SHUT_RDWR)
|
||||||
self._sock.close()
|
self._sock.close()
|
||||||
except socket.error, (errnum, errstr):
|
except socket.error, (errnum, errstr):
|
||||||
log.error('Error while disconnecting socket: %s' % errstr)
|
log.info('Error while disconnecting socket: %s' % errstr)
|
||||||
self.fd = -1
|
self.fd = -1
|
||||||
NonBlockingTransport.disconnect(self, do_callback)
|
NonBlockingTransport.disconnect(self, do_callback)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue