diff options
author | Jenkins <jenkins@review.openstack.org> | 2012-06-05 18:45:18 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-06-05 18:45:18 +0000 |
commit | 5a24235c22d259469e32febd58adb72c57880b2d (patch) | |
tree | d2b80fb036521b0988a7603699a6c379f7463e8b | |
parent | 84969afb3bfd467a2f48cf030a325c1a2fcd13ca (diff) | |
parent | 05130daeaa490070c52499c9fac26dd16c38074d (diff) | |
download | nova-5a24235c22d259469e32febd58adb72c57880b2d.tar.gz nova-5a24235c22d259469e32febd58adb72c57880b2d.tar.xz nova-5a24235c22d259469e32febd58adb72c57880b2d.zip |
Merge "fix bug lp:1009041,add option "-F" to make mkfs non-interactive."
-rw-r--r-- | nova/tests/test_libvirt.py | 2 | ||||
-rw-r--r-- | nova/virt/libvirt/utils.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index 62ab9efc4..596d6d1f1 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -2311,7 +2311,7 @@ disk size: 4.4M''', '')) def test_mkfs(self): self.mox.StubOutWithMock(utils, 'execute') - utils.execute('mkfs', '-t', 'ext4', '/my/block/dev') + utils.execute('mkfs', '-t', 'ext4', '-F', '/my/block/dev') utils.execute('mkswap', '/my/swap/block/dev') self.mox.ReplayAll() diff --git a/nova/virt/libvirt/utils.py b/nova/virt/libvirt/utils.py index 9f63c13c1..40b8d98d5 100644 --- a/nova/virt/libvirt/utils.py +++ b/nova/virt/libvirt/utils.py @@ -150,6 +150,9 @@ def mkfs(fs, path, label=None): execute('mkswap', path) 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: args.extend(['-n', label]) args.append(path) |