Python 3 deprecated the logger.warn method in favor of warning

Python 3 deprecated the logger.warn method, see:
https://docs.python.org/3/library/logging.html#logging.warning, so we
prefer to use warning to avoid DeprecationWarning.

Change-Id: I873e4d8da3bda87041f4041371d0dbdae541b92e
This commit is contained in:
BinBin Cong 2016-02-17 11:22:46 +00:00
parent be24b924b8
commit c7f7feb0b3
2 changed files with 4 additions and 4 deletions

View File

@ -480,8 +480,8 @@ class TempestAccountGenerator(command.Command):
def main(opts=None):
setup_logging()
if not opts:
LOG.warn("Use of: 'tempest-account-generator' is deprecated, "
"please use: 'tempest account-generator'")
LOG.warning("Use of: 'tempest-account-generator' is deprecated, "
"please use: 'tempest account-generator'")
opts = get_options()
if opts.config_file:
config.CONF.set_config_path(opts.config_file)

View File

@ -85,8 +85,8 @@ class StressAction(object):
finally:
shared_statistic['runs'] += 1
if self.stop_on_error and (shared_statistic['fails'] > 1):
self.logger.warn("Stop process due to"
"\"stop-on-error\" argument")
self.logger.warning("Stop process due to"
"\"stop-on-error\" argument")
self.tearDown()
sys.exit(1)