]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
use cinder utils.get_root_helper
authorWalter A. Boring IV <walter.boring@hp.com>
Wed, 2 Oct 2013 18:24:25 +0000 (11:24 -0700)
committerWalter A. Boring IV <walter.boring@hp.com>
Fri, 4 Oct 2013 20:01:45 +0000 (13:01 -0700)
Replaced all of the manual entries of
the root_helper with the cinder
utils.get_root_helper()

Closes-Bug: #1233907

Change-Id: I4c9b4c27ed4b779595a272436d79ec068e7ee537

cinder/volume/drivers/lvm.py
cinder/volume/utils.py

index 862fe238f118995f069b21a04c7274d8fdad969a..3b48840c3e56a00839be238c6b44dbbb8de80dc9 100644 (file)
@@ -704,7 +704,7 @@ class LVMISCSIDriver(LVMVolumeDriver, driver.ISCSIDriver):
                 LOG.error(_('%s'), message)
                 return false_ret
 
-            helper = 'sudo cinder-rootwrap %s' % CONF.rootwrap_config
+            helper = utils.get_root_helper()
             dest_vg_ref = lvm.LVM(dest_vg, helper, lvm_type, self._execute)
             self.remove_export(ctxt, volume)
             self._create_volume(volume['name'],
index 7b6dce592b5a6e17b8c78c7b6c5c915363e43a79..0014d400953df96cf774ea1a9d9310304d7cb20e 100644 (file)
@@ -198,22 +198,22 @@ def copy_volume(srcstr, deststr, size_in_m, sync=False,
 
 def supports_thin_provisioning():
     return brick_lvm.LVM.supports_thin_provisioning(
-        'sudo cinder-rootwrap %s' % CONF.rootwrap_config)
+        utils.get_root_helper())
 
 
 def get_all_volumes(vg_name=None, no_suffix=True):
     return brick_lvm.LVM.get_all_volumes(
-        'sudo cinder-rootwrap %s' % CONF.rootwrap_config,
+        utils.get_root_helper(),
         vg_name, no_suffix)
 
 
 def get_all_physical_volumes(vg_name=None, no_suffix=True):
     return brick_lvm.LVM.get_all_physical_volumes(
-        'sudo cinder-rootwrap %s' % CONF.rootwrap_config,
+        utils.get_root_helper(),
         vg_name, no_suffix)
 
 
 def get_all_volume_groups(vg_name=None, no_suffix=True):
     return brick_lvm.LVM.get_all_volume_groups(
-        'sudo cinder-rootwrap %s' % CONF.rootwrap_config,
+        utils.get_root_helper(),
         vg_name, no_suffix)