Commit 038c6cde authored by fedor.brunner's avatar fedor.brunner
Browse files

Replace the obsolete method warn.

http://docs.python.org/3/library/logging.html

  Note:
  There is an obsolete method warn which is functionally identical to
  warning. As warn is deprecated, please do not use it - use warning
  instead.
parent b84b024d
......@@ -582,7 +582,7 @@ class NonBlockingNonSASL(PlugIn):
query.setTagData('hash', hash_)
self._method='0k'
else:
log.warn("Secure methods unsupported, performing plain text \
log.warning("Secure methods unsupported, performing plain text \
authentication")
self._method = 'plain'
self._owner._caller.get_password(self._on_password, self._method)
......
......@@ -129,7 +129,7 @@ class NonBlockingBOSH(NonBlockingTransport):
if self.get_state() != DISCONNECTED and self.fd != -1:
NonBlockingTransport.set_timeout(self, timeout)
else:
log.warn('set_timeout: TIMEOUT NOT SET: state is %s, fd is %s' % (self.get_state(), self.fd))
log.warning('set_timeout: TIMEOUT NOT SET: state is %s, fd is %s' % (self.get_state(), self.fd))
def on_http_request_possible(self):
"""
......@@ -216,7 +216,7 @@ class NonBlockingBOSH(NonBlockingTransport):
# sent after HTTP response from CM, exception is when we're disconnecting - then we
# send anyway
if total_pending_reqs >= self.bosh_requests and self.get_state()!=DISCONNECTING:
log.warn('attemp to make more requests than allowed by Connection Manager:\n%s' %
log.warning('attemp to make more requests than allowed by Connection Manager:\n%s' %
self.get_current_state())
return
......@@ -309,7 +309,7 @@ class NonBlockingBOSH(NonBlockingTransport):
:param socket: disconnected transport object
"""
if socket.http_persistent:
log.warn('Fallback to nonpersistent HTTP (no pipelining as well)')
log.warning('Fallback to nonpersistent HTTP (no pipelining as well)')
socket.http_persistent = False
self.http_persistent = False
self.http_pipelining = False
......
......@@ -428,12 +428,12 @@ class XMPPDispatcher(PlugIn):
# log.info('in dispatch, getting ns for %s, and the ns is %s'
# % (stanza, xmlns))
if xmlns not in self.handlers:
log.warn("Unknown namespace: " + xmlns)
log.warning("Unknown namespace: " + xmlns)
xmlns = 'unknown'
# features stanza has been handled before
if name not in self.handlers[xmlns]:
if name != 'features':
log.warn("Unknown stanza: " + name)
log.warning("Unknown stanza: " + name)
else:
log.debug("Got %s/%s stanza" % (xmlns, name))
name='unknown'
......
......@@ -52,7 +52,7 @@ def urisplit(uri):
try:
port = splitted.port
except ValueError:
log.warn('port cannot be extracted from BOSH URL %s, using default port' \
log.warning('port cannot be extracted from BOSH URL %s, using default port' \
% uri)
port = ''
if not port:
......@@ -224,7 +224,7 @@ class NonBlockingTransport(PlugIn):
if hasattr(self, '_owner') and hasattr(self._owner, 'Dispatcher'):
self.on_receive = self._owner.Dispatcher.ProcessNonBlocking
else:
log.warn('No Dispatcher plugged. Received data will not be processed')
log.warning('No Dispatcher plugged. Received data will not be processed')
self.on_receive = None
return
self.on_receive = recv_handler
......@@ -482,14 +482,14 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
if self.get_state() != DISCONNECTED and self.fd != -1:
NonBlockingTransport.set_timeout(self, timeout)
else:
log.warn('set_timeout: TIMEOUT NOT SET: state is %s, fd is %s' %
log.warning('set_timeout: TIMEOUT NOT SET: state is %s, fd is %s' %
(self.get_state(), self.fd))
def remove_timeout(self):
if self.fd:
NonBlockingTransport.remove_timeout(self)
else:
log.warn('remove_timeout: no self.fd state is %s' % self.get_state())
log.warning('remove_timeout: no self.fd state is %s' % self.get_state())
def send(self, raw_data, now=False):
"""
......@@ -542,7 +542,7 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
"""
if not self.sendbuff:
if not self.sendqueue:
log.warn('calling send on empty buffer and queue')
log.warning('calling send on empty buffer and queue')
self._plug_idle(writable=False, readable=True)
return None
self.sendbuff = self.sendqueue.pop(0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment