logging.warning instead of warn to assuage py 3.7

This commit is contained in:
Noah Levitt 2019-05-16 23:29:55 +00:00
parent f7fc7da725
commit f26704a206
2 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ class RethinkerWrapper(object):
'^Cannot perform.*replica.*', e.args[0]): '^Cannot perform.*replica.*', e.args[0]):
if error_count < 20: if error_count < 20:
error_count += 1 error_count += 1
self.logger.warn( self.logger.warning(
'will keep trying after potentially ' 'will keep trying after potentially '
'recoverable error (%s/20): %s', 'recoverable error (%s/20): %s',
error_count, e) error_count, e)
@ -90,7 +90,7 @@ class RethinkerWrapper(object):
except r.ReqlOpFailedError as e: except r.ReqlOpFailedError as e:
if e.args and re.match( if e.args and re.match(
'^Cannot perform.*replica.*', e.args[0]): '^Cannot perform.*replica.*', e.args[0]):
self.logger.warn( self.logger.warning(
'will keep trying after potentially recoverable ' 'will keep trying after potentially recoverable '
'error: %s', e) 'error: %s', e)
time.sleep(0.5) time.sleep(0.5)
@ -129,7 +129,7 @@ class Rethinker(object):
return r.connect(host=server) return r.connect(host=server)
except Exception as e: except Exception as e:
self.last_error[server] = time.time() self.last_error[server] = time.time()
self.logger.warn( self.logger.warning(
'will keep trying after failure connecting to ' 'will keep trying after failure connecting to '
'rethinkdb server at %s: %s (sleeping for %s sec)', 'rethinkdb server at %s: %s (sleeping for %s sec)',
server, e, retry_wait) server, e, retry_wait)

View File

@ -168,7 +168,7 @@ class ServiceRegistry(object):
if result != { if result != {
'deleted':1, 'errors':0,'inserted':0, 'deleted':1, 'errors':0,'inserted':0,
'replaced':0,'skipped':0,'unchanged':0}: 'replaced':0,'skipped':0,'unchanged':0}:
self.logger.warn( self.logger.warning(
'unexpected result attempting to delete id=%s from ' 'unexpected result attempting to delete id=%s from '
'rethinkdb services table: %s', id, result) 'rethinkdb services table: %s', id, result)