Merge lp:~hopem/charm-helpers/lp1257491 into lp:charm-helpers

Proposed by Edward Hope-Morley
Status: Superseded
Proposed branch: lp:~hopem/charm-helpers/lp1257491
Merge into: lp:charm-helpers
Diff against target: 23 lines (+3/-2)
2 files modified
charmhelpers/contrib/storage/linux/utils.py (+1/-1)
tests/contrib/storage/test_linux_storage_utils.py (+2/-1)
To merge this branch: bzr merge lp:~hopem/charm-helpers/lp1257491
Reviewer Review Type Date Requested Status
James Page Needs Fixing
Review via email: mp+198224@code.launchpad.net

This proposal has been superseded by a proposal from 2013-12-09.

To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :

Hi Ed

Please update the associated test as well;

======================================================================
FAIL: It calls sgdisk correctly to zap disk
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jamespage/src/charms/charm-helpers/charm-helpers/tests/contrib/storage/test_linux_storage_utils.py", line 15, in test_zap_disk
    check_call.assert_called_with(['sgdisk', '--zap-all', '/dev/foo'])
  File "/usr/lib/python2.7/dist-packages/mock.py", line 835, in assert_called_with
    raise AssertionError(msg)
AssertionError: Expected call: check_call(['sgdisk', '--zap-all', '/dev/foo'])
Actual call: check_call(['sgdisk', '--zap-all', '--mbrtogpt', '/dev/foo'])

I was also pondering whether target format should be an option (MBR or GPT) but I guess this covers 100% of use cases right now.

Ta

review: Needs Fixing
lp:~hopem/charm-helpers/lp1257491 updated
108. By Edward Hope-Morley

fixed unit test

Unmerged revisions

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-06-24 22:39:29 +0000
3+++ charmhelpers/contrib/storage/linux/utils.py 2013-12-09 14:09:16 +0000
4@@ -22,4 +22,4 @@
5
6 :param block_device: str: Full path of block device to clean.
7 '''
8- check_call(['sgdisk', '--zap-all', block_device])
9+ check_call(['sgdisk', '--zap-all', '--mbrtogpt', block_device])
10
11=== modified file 'tests/contrib/storage/test_linux_storage_utils.py'
12--- tests/contrib/storage/test_linux_storage_utils.py 2013-06-24 22:39:29 +0000
13+++ tests/contrib/storage/test_linux_storage_utils.py 2013-12-09 14:09:16 +0000
14@@ -12,7 +12,8 @@
15 '''It calls sgdisk correctly to zap disk'''
16 with patch(STORAGE_LINUX_UTILS + '.check_call') as check_call:
17 storage_utils.zap_disk('/dev/foo')
18- check_call.assert_called_with(['sgdisk', '--zap-all', '/dev/foo'])
19+ check_call.assert_called_with(['sgdisk', '--zap-all', '--mbrtogpt',
20+ '/dev/foo'])
21
22 @patch(STORAGE_LINUX_UTILS + '.stat')
23 @patch(STORAGE_LINUX_UTILS + '.S_ISBLK')

Subscribers

People subscribed via source and target branches