Eli Mesika has uploaded a new change for review.

Change subject: core: Option with empty name and value ...
......................................................................

core: Option with empty name and value ...

Option with empty name and value in the request's xml to rest-api should
not be allowed.

The problem is not with the PM options, this is working without a
problem.
There is a leading blank in the UUID of the DC in the request that
caused the exception.
Adding a check for DC ID validity in canDoAction of
ConnectStorageToVdsCommand command.

Change-Id: Ife629f861c1dfa9e0ab57392b77a09d79fe65d47
Signed-off-by: Eli Mesika <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ConnectStorageToVdsCommand.java
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/21/7321/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ConnectStorageToVdsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ConnectStorageToVdsCommand.java
index eed4d5b..30ef0e6 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ConnectStorageToVdsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ConnectStorageToVdsCommand.java
@@ -5,6 +5,7 @@
 import org.ovirt.engine.core.bll.Backend;
 import org.ovirt.engine.core.bll.InternalCommandAttribute;
 import 
org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase;
+import org.ovirt.engine.core.common.businessentities.storage_pool;
 import 
org.ovirt.engine.core.common.businessentities.storage_server_connections;
 import org.ovirt.engine.core.common.errors.VdcFault;
 import 
org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters;
@@ -22,6 +23,14 @@
 
     @Override
     protected boolean canDoAction() {
+        Guid id = getParameters().getStoragePoolId();
+        if (id != null && !id.equals(Guid.Empty)) {
+            storage_pool dc = getStoragePoolDAO().get(id);
+            if (dc == null) {
+                
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST);
+                return false;
+            }
+        }
         if (!StorageHelperDirector.getInstance()
                 
.getItem(getParameters().getStorageServerConnection().getstorage_type())
                 .ValidateStoragePoolConnectionsInHost(getVds(),


--
To view, visit http://gerrit.ovirt.org/7321
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife629f861c1dfa9e0ab57392b77a09d79fe65d47
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to