summaryrefslogtreecommitdiff
path: root/cinder/privsep
diff options
context:
space:
mode:
authorCharles Short <chucks@redhat.com>2019-01-30 13:14:09 -0500
committerCharles Short <chucks@redhat.com>2019-02-17 14:33:31 -0500
commitec6eaa21fd08cb7e6fa950e303a626a99580ec89 (patch)
tree4853cc0b30ade1ad7ca2f779544ed61a39c5752f /cinder/privsep
parent1e698dbf3996cdbed8bcd7887684b12d13415877 (diff)
downloadcinder-ec6eaa21fd08cb7e6fa950e303a626a99580ec89.tar.gz
Replace 'lvconvert' from rootwrap
Use oslo.privsep to run the lvconvert command. Change-Id: I6c2dce7beb1c3f8bb777066f62ced134f763e640 Signed-off-by: Charles Short <chucks@redhat.com>
Diffstat (limited to 'cinder/privsep')
-rw-r--r--cinder/privsep/lvm.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/cinder/privsep/lvm.py b/cinder/privsep/lvm.py
index cfa48af57..2da0659d2 100644
--- a/cinder/privsep/lvm.py
+++ b/cinder/privsep/lvm.py
@@ -36,3 +36,9 @@ def lvrename(vg_name, lv_name, new_name):
def create_vg(vg_name, pv_list):
cmd = ['vgcreate', vg_name, ','.join(pv_list)]
processutils.execute(*cmd)
+
+
+@cinder.privsep.sys_admin_pctxt.entrypoint
+def lvconvert(vg_name, snapshot_name):
+ processutils.execute(
+ 'lvconvert', '--merge', '%s/%s' % (vg_name, snapshot_name))