diff --git a/cinder/tests/unit/volume/test_volume.py b/cinder/tests/unit/volume/test_volume.py index 97ca251c212..4c7d5335002 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 01fc5d78849..cb6a28a7362 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']),