Restore blkid compatibility with Centos 7
The blkid version included in util-linux 2.23.2 does not allow long
options name for probe and match-tag.
Use the short single letter name to restore compatibility with Centos 7
Story: 2009328
Task: 43764
Change-Id: I10a52c16ebe4e519d0af63b36c3a89fd5d371319
(cherry picked from commit 731e2f9c82
)
This commit is contained in:
parent
df502f976a
commit
b19124eae2
|
@ -191,9 +191,9 @@ def get_partition_table_type(device):
|
|||
def _blkid(device, probe=False, fields=None):
|
||||
args = []
|
||||
if probe:
|
||||
args.append('--probe')
|
||||
args.append('-p')
|
||||
if fields:
|
||||
args += sum((['--match-tag', field] for field in fields), [])
|
||||
args += sum((['-s', field] for field in fields), [])
|
||||
|
||||
output, err = utils.execute('blkid', device, *args,
|
||||
use_standard_locale=True, run_as_root=True)
|
||||
|
|
|
@ -926,7 +926,7 @@ class GetDeviceInformationTestCase(base.IronicLibTestCase):
|
|||
mock_execute.return_value = BLKID_PROBE, ""
|
||||
result = disk_utils.get_device_information('/dev/fake', probe=True)
|
||||
self.assertEqual({'PTUUID': '123456', 'PTTYPE': 'gpt'}, result)
|
||||
mock_execute.assert_called_once_with('blkid', '/dev/fake', '--probe',
|
||||
mock_execute.assert_called_once_with('blkid', '/dev/fake', '-p',
|
||||
use_standard_locale=True,
|
||||
run_as_root=True)
|
||||
|
||||
|
@ -950,8 +950,7 @@ class GetDeviceInformationTestCase(base.IronicLibTestCase):
|
|||
result = disk_utils.get_device_information('/dev/fake', probe=True)
|
||||
self.assertEqual({}, result)
|
||||
mock_execute.assert_called_once_with('blkid', '/dev/fake',
|
||||
'--probe',
|
||||
use_standard_locale=True,
|
||||
'-p', use_standard_locale=True,
|
||||
run_as_root=True)
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
Restore compatibility of blkid command with CentOS 7. For more details
|
||||
see `Story 2009328 <https://storyboard.openstack.org/#!/story/2009328>`_.
|
Loading…
Reference in New Issue