Fix creating config drive for whole disk images
The execute utility returns (out, err), not just out.
Change-Id: I322ddae8026493eed2d1ac3c8d446e870b09e711
Closes-Bug: #1626544
(cherry picked from commit 33af42c965
)
This commit is contained in:
parent
8591decf49
commit
7323bf50e6
@ -568,7 +568,7 @@ def _is_disk_larger_than_max_size(device, node_uuid):
|
||||
LOG.error(msg)
|
||||
raise exception.InstanceDeployFailure(msg)
|
||||
|
||||
disksize_mb = int(disksize_bytes) // 1024 // 1024
|
||||
disksize_mb = int(disksize_bytes[0].strip()) // 1024 // 1024
|
||||
|
||||
return disksize_mb > MAX_DISK_SIZE_MB_SUPPORTED_BY_MBR
|
||||
|
||||
|
@ -738,7 +738,7 @@ class WholeDiskPartitionTestCases(test_base.BaseTestCase):
|
||||
self.assertEqual(1, mock_log.call_count)
|
||||
|
||||
def _test_is_disk_larger_than_max_size(self, mock_execute, blk_out):
|
||||
mock_execute.return_value = blk_out
|
||||
mock_execute.return_value = ('%s\n' % blk_out, '')
|
||||
result = disk_utils._is_disk_larger_than_max_size(self.dev,
|
||||
self.node_uuid)
|
||||
mock_execute.assert_called_once_with('blockdev', '--getsize64',
|
||||
|
Loading…
Reference in New Issue
Block a user