From 32bb44973085b48249138e2359be9c843a371a9d Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Tue, 28 Jan 2020 09:14:36 -0500 Subject: [PATCH] Skip cryptsetup password quality checking LUKS password quality checking is not useful since we only use long hex strings for passwords. Not skipping this means that we have to install cracklib-dicts for cryptsetup to work, which is unnecessary weight. Closes-Bug: #1861120 Change-Id: I1105c16caaf916e9101b6dca34a7f13936ce2240 (cherry picked from commit 7c3621311a320344a2b158a325fb5f797aa16a4a) --- cinder/tests/unit/volume/test_volume.py | 1 + cinder/volume/flows/manager/create_volume.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/cinder/tests/unit/volume/test_volume.py b/cinder/tests/unit/volume/test_volume.py index e53441ab707..4697f9d76a9 100644 --- a/cinder/tests/unit/volume/test_volume.py +++ b/cinder/tests/unit/volume/test_volume.py @@ -1679,6 +1679,7 @@ class VolumeTestCase(base.BaseVolumeTestCase): mock_execute.assert_called_once_with( 'cryptsetup', 'luksChangeKey', '/some/device/thing', + '--force-password', log_errors=processutils.LOG_ALL_ERRORS, process_input='qwert\nasdfg\n', run_as_root=True) diff --git a/cinder/volume/flows/manager/create_volume.py b/cinder/volume/flows/manager/create_volume.py index 3dafa169610..27cd40bd6ed 100644 --- a/cinder/volume/flows/manager/create_volume.py +++ b/cinder/volume/flows/manager/create_volume.py @@ -559,6 +559,7 @@ class CreateVolumeFromSpecTask(flow_utils.CinderTask): 'cryptsetup', 'luksChangeKey', attach_info['device']['path'], + '--force-password', run_as_root=True, process_input=key_str, log_errors=processutils.LOG_ALL_ERRORS) @@ -583,6 +584,7 @@ class CreateVolumeFromSpecTask(flow_utils.CinderTask): 'cryptsetup', '--batch-mode', 'luksFormat', + '--force-password', '--type', encryption['provider'], '--cipher', encryption['cipher'], '--key-size', str(encryption['key_size']),