diff --git a/src/components/storage/CockpitStorageIntegration.jsx b/src/components/storage/CockpitStorageIntegration.jsx index 4b2f590d7..e0de1e9f6 100644 --- a/src/components/storage/CockpitStorageIntegration.jsx +++ b/src/components/storage/CockpitStorageIntegration.jsx @@ -257,27 +257,18 @@ const CheckStorageDialog = ({ return; } - const cockpitDevices = ( - Object.keys(newMountPoints) - .map(devicePath => ({ - devicePath, - deviceName: getDeviceNameByPath(deviceData, devicePath), - })) - ); - const devicesToUnlock = ( - cockpitDevices + Object.keys(cockpitPassphrases) + .map(dev => ({ + deviceName: deviceData[dev] ? dev : getDeviceNameByPath(deviceData, dev), + passphrase: cockpitPassphrases[dev] + }))) .filter(({ devicePath, deviceName }) => { return ( - newMountPoints[devicePath].type === "crypto" && + deviceData[deviceName].formatData.type.v === "luks" && deviceData[deviceName].formatData.attrs.v.has_key !== "True" ); }) - .map(({ devicePath, deviceName }) => ({ - deviceName, - passphrase: cockpitPassphrases[devicePath], - })) - ); if (devicesToUnlock.some(dev => !dev.passphrase)) { onCritFail()({ message: _("Cockpit storage did not provide the passphrase to unlock encrypted device.") }); @@ -341,11 +332,7 @@ const CheckStorageDialog = ({ task, onSuccess: () => dispatch(getDevicesAction()) .then(() => { - if (useConfiguredStorage) { - setCheckStep("luks"); - } else { - setCheckStep(); - } + setCheckStep("luks"); }) .catch(exc => { setCheckStep();