Replace LOG.warn with LOG.warning

logging.warn is deprecated in Python 3.[1]
[1] https://docs.python.org/3/library/logging.html#logging.warning

Change-Id: Ia87055a5bf51aade370e69921956aee0189304a4
This commit is contained in:
gecong1973 2016-11-16 15:14:34 +08:00 committed by gecong
parent db19b04d7f
commit eb8d3777ad
3 changed files with 7 additions and 7 deletions

View File

@ -532,8 +532,8 @@ def get_backup_args():
if log_file:
CONF.set_default('log_file', log_file)
else:
LOG.warn("log file cannot be created. Freezer will proceed with "
"default stdout and stderr")
LOG.warning("log file cannot be created. Freezer will proceed with"
" default stdout and stderr")
backup_args = FreezerConfig(defaults)
@ -648,8 +648,8 @@ def get_backup_args():
else:
os.environ["tricklecount"] = str(1)
else:
LOG.warn("Trickle not found. Switching to normal mode without "
"limiting bandwidth")
LOG.warning("Trickle not found. Switching to normal mode without "
"limiting bandwidth")
if backup_args.config:
# remove index tmp_file from backup arguments dict
utils.delete_file(conf_file.name)

View File

@ -102,7 +102,7 @@ def freezer_main(backup_args):
utils.delete_file(backup_args.tmp_file)
if process.returncode:
LOG.warn("Trickle Error: {0}".format(error))
LOG.warning("Trickle Error: {0}".format(error))
LOG.info("Switching to work without trickle ...")
return run_job(backup_args, storage)

View File

@ -236,7 +236,7 @@ class OSClientManager(object):
time.sleep(5)
except Exception as e:
LOG.exception(e)
LOG.warn("Exception getting volume status")
LOG.warning("Exception getting volume status")
return volume
def make_glance_image(self, image_volume_name, copy_volume):
@ -264,7 +264,7 @@ class OSClientManager(object):
if image.status in ("killed", "deleted"):
raise
LOG.exception(e)
LOG.warn("Exception getting image status")
LOG.warning("Exception getting image status")
return image
def clean_snapshot(self, snapshot):