]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Replace warnings.warn in glusterfs
authorXi Yang <yang.xi@99cloud.net>
Tue, 3 Nov 2015 05:44:29 +0000 (13:44 +0800)
committerXi Yang <yang.xi@99cloud.net>
Tue, 3 Nov 2015 07:01:41 +0000 (15:01 +0800)
There is a warning message logged by warnings.warn,
it should be replaced by LOG.warn.

Change-Id: Ia15d2cdfe6ed1b000a399bbdd0ccafe02aaa0197

cinder/volume/drivers/glusterfs.py

index dca3be61580a504be2454c658385ba04cf24f5af..5a865a37231fc8520294df998bd14655ce50373d 100644 (file)
@@ -16,7 +16,6 @@
 import errno
 import os
 import stat
-import warnings
 
 from os_brick.remotefs import remotefs as remotefs_brick
 from oslo_concurrency import processutils
@@ -348,8 +347,9 @@ class GlusterfsDriver(remotefs_drv.RemoteFSSnapDriver, driver.CloneableVD,
                 self._fallocate(volume_path, volume_size)
             except processutils.ProcessExecutionError as exc:
                 if 'Operation not supported' in exc.stderr:
-                    warnings.warn('Fallocate not supported by current version '
-                                  'of glusterfs. So falling back to dd.')
+                    LOG.warning(_LW('Fallocate not supported by current '
+                                    'version of glusterfs. So falling '
+                                    'back to dd.'))
                     self._create_regular_file(volume_path, volume_size)
                 else:
                     fileutils.delete_if_exists(volume_path)