Hello Federico Simoncelli,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/19520
to review the following change.
Change subject: backend: prevent destroy command on glance domains
......................................................................
backend: prevent destroy command on glance domains
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1006878
Change-Id: Idfb6f61d63d2bff7a3131eab82d24a9f7c4645c3
Signed-off-by: Federico Simoncelli <[email protected]>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ForceRemoveStorageDomainCommand.java
M
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java
2 files changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/20/19520/1
diff --git
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ForceRemoveStorageDomainCommand.java
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ForceRemoveStorageDomainCommand.java
index c0473c4..a14d310 100644
---
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ForceRemoveStorageDomainCommand.java
+++
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ForceRemoveStorageDomainCommand.java
@@ -13,6 +13,7 @@
import org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus;
import org.ovirt.engine.core.common.businessentities.StorageDomainStatus;
import org.ovirt.engine.core.common.businessentities.StorageDomainType;
+import org.ovirt.engine.core.common.businessentities.StorageType;
import org.ovirt.engine.core.common.errors.VdcBllMessages;
import org.ovirt.engine.core.common.locks.LockingGroup;
import org.ovirt.engine.core.common.utils.Pair;
@@ -96,6 +97,12 @@
addCanDoActionMessage(VdcBllMessages.ERROR_CANNOT_DESTROY_LAST_STORAGE_DOMAIN_HOST_NOT_ACTIVE);
}
}
+
+ if (returnValue && getStorageDomain().getStorageType() ==
StorageType.GLANCE) {
+
addCanDoActionMessage(VdcBllMessages.ERROR_CANNOT_MANAGE_STORAGE_DOMAIN);
+ returnValue = false;
+ }
+
return returnValue;
}
diff --git
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java
index 8e946ef..6000a85 100644
---
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java
+++
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/StorageListModel.java
@@ -1130,6 +1130,7 @@
&& Linq.findAllStorageDomainsBySharedStatus(items,
StorageDomainSharedStatus.Unattached).size() == items.size());
getDestroyCommand().setIsExecutionAllowed(item != null && items.size()
== 1
+ && items.get(0).getStorageType() != StorageType.GLANCE
&& item.getStatus() != StorageDomainStatus.Active);
// System tree dependent actions.
--
To view, visit http://gerrit.ovirt.org/19520
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idfb6f61d63d2bff7a3131eab82d24a9f7c4645c3
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Tal Nisan <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches