Fix creating config drive for whole disk images

The execute utility returns (out, err), not just out.

Change-Id: I322ddae8026493eed2d1ac3c8d446e870b09e711
Closes-Bug: #1626544
This commit is contained in:
Dmitry Tantsur 2016-09-22 15:51:22 +02:00
parent 36109e58f2
commit 33af42c965
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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',