Skip to content

Commit

Permalink
use cinder utils.get_root_helper
Browse files Browse the repository at this point in the history
Replaced all of the manual entries of
the root_helper with the cinder
utils.get_root_helper()

Closes-Bug: #1233907

Change-Id: I4c9b4c27ed4b779595a272436d79ec068e7ee537
  • Loading branch information
hemna committed Oct 4, 2013
1 parent 3cd27de commit a9a3608
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cinder/volume/drivers/lvm.py
Expand Up @@ -704,7 +704,7 @@ def migrate_volume(self, ctxt, volume, host, thin=False, mirror_count=0):
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'],
Expand Down
8 changes: 4 additions & 4 deletions cinder/volume/utils.py
Expand Up @@ -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)

0 comments on commit a9a3608

Please sign in to comment.