From 2fc63daa1b981d50311e61c300d1c50112d0f982 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Tue, 12 Dec 2017 03:28:41 +1100 Subject: [PATCH] Move makefs to privsep Change-Id: I388d31d5e9c1cff10bc534ba69be899e67681ce6 blueprint: hurrah-for-privsep --- nova/utils.py | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/nova/utils.py b/nova/utils.py index 9d835fcd7..fb37941c7 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -723,31 +723,6 @@ class UndoManager(object): self._rollback() -def mkfs(fs, path, label=None, run_as_root=False): - """Format a file or block device - - :param fs: Filesystem type (examples include 'swap', 'ext3', 'ext4' - 'btrfs', etc.) - :param path: Path to file or block device to format - :param label: Volume label to use - """ - if fs == 'swap': - args = ['mkswap'] - else: - args = ['mkfs', '-t', fs] - # add -F to force no interactive execute on non-block device. - if fs in ('ext3', 'ext4', 'ntfs'): - args.extend(['-F']) - if label: - if fs in ('msdos', 'vfat'): - label_opt = '-n' - else: - label_opt = '-L' - args.extend([label_opt, label]) - args.append(path) - execute(*args, run_as_root=run_as_root) - - def metadata_to_dict(metadata, include_deleted=False): result = {} for item in metadata: