summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 398c620f8..d9ded16b6 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -1160,17 +1160,17 @@ def mkfs(fs, path, label=None):
:param label: Volume label to use
"""
if fs == 'swap':
- execute('mkswap', path)
+ args = ['mkswap']
else:
args = ['mkfs', '-t', fs]
- #add -F to force no interactive excute on non-block device.
- if fs in ('ext3', 'ext4'):
- 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)
+ #add -F to force no interactive execute on non-block device.
+ if fs in ('ext3', 'ext4'):
+ 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)