summaryrefslogtreecommitdiff
path: root/cinder/privsep
diff options
context:
space:
mode:
authorCharles Short <chucks@redhat.com>2019-01-11 14:33:19 +0000
committerEric Harney <eharney@redhat.com>2019-02-21 16:34:01 -0500
commita62c9dfdd41ab0be8bedd99ca39b82701d73ef4f (patch)
tree2d46b5313bbd9deb6c4fd49764a50099a21ee863 /cinder/privsep
parentb98441033303fa262512900d95ace87497e2056d (diff)
downloadcinder-a62c9dfdd41ab0be8bedd99ca39b82701d73ef4f.tar.gz
Remove truncate from rootwrap filters
Use oslo.privsep for the truncate command. Change-Id: Ic287c64a4e0f663738e23d22e819b6ffee9c84c1 Signed-off-by: Charles Short <chucks@redhat.com>
Diffstat (limited to 'cinder/privsep')
-rw-r--r--cinder/privsep/fs.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cinder/privsep/fs.py b/cinder/privsep/fs.py
index e788d4e6c..f880a6d8c 100644
--- a/cinder/privsep/fs.py
+++ b/cinder/privsep/fs.py
@@ -27,3 +27,8 @@ import cinder.privsep
@cinder.privsep.sys_admin_pctxt.entrypoint
def umount(mountpoint):
processutils.execute('umount', mountpoint, attempts=1, delay_on_retry=True)
+
+
+@cinder.privsep.sys_admin_pctxt.entrypoint
+def truncate(size, path):
+ processutils.execute('truncate', '-s', size, path)