Replace deprecated LOG.warn with LOG.warning

LOG.warn is deprecated so this replaces it with LOG.warning.

Change-Id: I4b7b55cce2cfb3f0ae779351daf14e42472d43de
Closes-Bug: 1508442
This commit is contained in:
Ruby Loo 2015-11-23 15:57:02 +00:00
parent 92fdf322ce
commit bf3938e439
3 changed files with 7 additions and 7 deletions

View File

@ -87,10 +87,10 @@ def list_partitions(device):
for line in lines:
match = _PARTED_PRINT_RE.match(line)
if match is None:
LOG.warn(_LW("Partition information from parted for device "
"%(device)s does not match "
"expected format: %(line)s"),
dict(device=device, line=line))
LOG.warning(_LW("Partition information from parted for device "
"%(device)s does not match "
"expected format: %(line)s"),
dict(device=device, line=line))
continue
# Cast int fields to ints (some are floats and we round them down)
groups = [int(float(x)) if i < 4 else x

View File

@ -58,7 +58,7 @@ BYT;
'parted', '-s', '-m', '/dev/fake', 'unit', 'MiB', 'print',
use_standard_locale=True, run_as_root=True)
@mock.patch.object(disk_utils.LOG, 'warn')
@mock.patch.object(disk_utils.LOG, 'warning')
def test_incorrect(self, log_mock, execute_mock):
output = """
BYT;

View File

@ -119,8 +119,8 @@ def unlink_without_raise(path):
if e.errno == errno.ENOENT:
return
else:
LOG.warn(_LW("Failed to unlink %(path)s, error: %(e)s"),
{'path': path, 'e': e})
LOG.warning(_LW("Failed to unlink %(path)s, error: %(e)s"),
{'path': path, 'e': e})
def dd(src, dst, *args):