Fix proper error message on revert volume snapshot operation in case of any hypervisor other than KVM

This commit is contained in:
Harikrishna Patnala 2020-08-20 00:14:13 +05:30
parent ebe0e2bb24
commit d2d9b3c72f
1 changed files with 2 additions and 1 deletions

View File

@ -311,7 +311,8 @@ public class SnapshotManagerImpl extends MutualExclusiveIdsManagerBase implement
if (snapshotStrategy == null) {
s_logger.error("Unable to find snaphot strategy to handle snapshot with id '" + snapshotId + "'");
return null;
String errorMsg = String.format("Revert snapshot command failed for snapshot with id %d, because this command is supported only for KVM hypervisor", snapshotId);
throw new CloudRuntimeException(errorMsg);
}
boolean result = snapshotStrategy.revertSnapshot(snapshotInfo);