Merge lp:~james-page/charm-helpers/lp-1475247 into lp:charm-helpers

Proposed by James Page
Status: Merged
Merged at revision: 424
Proposed branch: lp:~james-page/charm-helpers/lp-1475247
Merge into: lp:charm-helpers
Diff against target: 32 lines (+6/-4)
2 files modified
charmhelpers/contrib/storage/linux/utils.py (+3/-2)
tests/contrib/storage/test_linux_storage_utils.py (+3/-2)
To merge this branch: bzr merge lp:~james-page/charm-helpers/lp-1475247
Reviewer Review Type Date Requested Status
Chris Glass (community) Approve
Adam Collard (community) Approve
Review via email: mp+265125@code.launchpad.net

Description of the change

Split calls to sgdisk

Ceph identified a hang condition that is resolved by splitting the calls
to sgdisk into two calls - one with zap-disk and the other with
clear/mbrtogpt.

To post a comment you must log in.
Revision history for this message
Adam Collard (adam-collard) wrote :

Looks good, one minor comment about the... comment

review: Approve
409. By James Page

Reference commit

Revision history for this message
Chris Glass (tribaal) wrote :

+1!

review: Approve

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 2015-01-22 06:06:03 +0000
3+++ charmhelpers/contrib/storage/linux/utils.py 2015-07-17 14:09:29 +0000
4@@ -43,9 +43,10 @@
5
6 :param block_device: str: Full path of block device to clean.
7 '''
8+ # https://github.com/ceph/ceph/commit/fdd7f8d83afa25c4e09aaedd90ab93f3b64a677b
9 # sometimes sgdisk exits non-zero; this is OK, dd will clean up
10- call(['sgdisk', '--zap-all', '--mbrtogpt',
11- '--clear', block_device])
12+ call(['sgdisk', '--zap-all', '--', block_device])
13+ call(['sgdisk', '--clear', '--mbrtogpt', '--', block_device])
14 dev_end = check_output(['blockdev', '--getsz',
15 block_device]).decode('UTF-8')
16 gpt_end = int(dev_end.split()[0]) - 100
17
18=== modified file 'tests/contrib/storage/test_linux_storage_utils.py'
19--- tests/contrib/storage/test_linux_storage_utils.py 2014-11-25 13:38:01 +0000
20+++ tests/contrib/storage/test_linux_storage_utils.py 2015-07-17 14:09:29 +0000
21@@ -16,8 +16,9 @@
22 '''It calls sgdisk correctly to zap disk'''
23 check_output.return_value = b'200\n'
24 storage_utils.zap_disk('/dev/foo')
25- call.assert_any_call(['sgdisk', '--zap-all', '--mbrtogpt',
26- '--clear', '/dev/foo'])
27+ call.assert_any_call(['sgdisk', '--zap-all', '--', '/dev/foo'])
28+ call.assert_any_call(['sgdisk', '--clear', '--mbrtogpt',
29+ '--', '/dev/foo'])
30 check_output.assert_any_call(['blockdev', '--getsz', '/dev/foo'])
31 check_call.assert_any_call(['dd', 'if=/dev/zero', 'of=/dev/foo',
32 'bs=1M', 'count=1'])

Subscribers

People subscribed via source and target branches