Merge lp:~james-page/charm-helpers/ceph-fix-zap into lp:charm-helpers

Proposed by James Page
Status: Merged
Merged at revision: 128
Proposed branch: lp:~james-page/charm-helpers/ceph-fix-zap
Merge into: lp:charm-helpers
Diff against target: 25 lines (+4/-3)
2 files modified
charmhelpers/contrib/storage/linux/utils.py (+2/-1)
tests/contrib/storage/test_linux_storage_utils.py (+2/-2)
To merge this branch: bzr merge lp:~james-page/charm-helpers/ceph-fix-zap
Reviewer Review Type Date Requested Status
Marco Ceppi Approve
Ryan Harper (community) Approve
Review via email: mp+209539@code.launchpad.net

Description of the change

Add --clear to sgdisk args to ensure that disks are actually zapped.

This is inline with ceph-disk upstream in Ceph.

To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :

I've successfully deployed the precise ceph charm now with this change in place.

review: Approve
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

Lgtm, +1

review: Approve
Revision history for this message
Matt Bruzek (mbruzek) wrote :

+1 LGTM According to the man page: http://manpages.ubuntu.com/manpages/natty/man8/sgdisk.8.html That option clears out all the partition data.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/storage/linux/utils.py'
2--- charmhelpers/contrib/storage/linux/utils.py 2013-12-09 10:59:08 +0000
3+++ charmhelpers/contrib/storage/linux/utils.py 2014-03-05 20:47:15 +0000
4@@ -22,4 +22,5 @@
5
6 :param block_device: str: Full path of block device to clean.
7 '''
8- check_call(['sgdisk', '--zap-all', '--mbrtogpt', block_device])
9+ check_call(['sgdisk', '--zap-all', '--clear',
10+ '--mbrtogpt', block_device])
11
12=== modified file 'tests/contrib/storage/test_linux_storage_utils.py'
13--- tests/contrib/storage/test_linux_storage_utils.py 2013-12-09 14:08:55 +0000
14+++ tests/contrib/storage/test_linux_storage_utils.py 2014-03-05 20:47:15 +0000
15@@ -12,8 +12,8 @@
16 '''It calls sgdisk correctly to zap disk'''
17 with patch(STORAGE_LINUX_UTILS + '.check_call') as check_call:
18 storage_utils.zap_disk('/dev/foo')
19- check_call.assert_called_with(['sgdisk', '--zap-all', '--mbrtogpt',
20- '/dev/foo'])
21+ check_call.assert_called_with(['sgdisk', '--zap-all', '--clear',
22+ '--mbrtogpt', '/dev/foo'])
23
24 @patch(STORAGE_LINUX_UTILS + '.stat')
25 @patch(STORAGE_LINUX_UTILS + '.S_ISBLK')

Subscribers

People subscribed via source and target branches