Michael Kublin has uploaded a new change for review.

Change subject: engine: Clean up of AddVdsVDSCommand
......................................................................

engine: Clean up of AddVdsVDSCommand

I have not any idea why that code was there and what was reason for it,
but these code is wrong, I removed it

Change-Id: I070093a2afb352e635b07673b720f37a56d543fd
Signed-off-by: Michael Kublin <mkub...@redhat.com>
---
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/AddVdsVDSCommand.java
1 file changed, 1 insertion(+), 19 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/67/8467/1

diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/AddVdsVDSCommand.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/AddVdsVDSCommand.java
index eb7f2aa..76339aa 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/AddVdsVDSCommand.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/AddVdsVDSCommand.java
@@ -3,11 +3,8 @@
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.vdscommands.AddVdsVDSCommandParameters;
 import org.ovirt.engine.core.dal.dbbroker.DbFacade;
-import org.ovirt.engine.core.utils.ThreadUtils;
 import org.ovirt.engine.core.utils.log.Log;
 import org.ovirt.engine.core.utils.log.LogFactory;
-import org.ovirt.engine.core.utils.transaction.TransactionMethod;
-import org.ovirt.engine.core.utils.transaction.TransactionSupport;
 
 public class AddVdsVDSCommand<P extends AddVdsVDSCommandParameters> extends 
VdsIdVDSCommandBase<P> {
     public AddVdsVDSCommand(P parameters) {
@@ -16,23 +13,8 @@
 
     @Override
     protected void ExecuteVdsIdCommand() {
-        VDS vds = null;
         log.infoFormat("AddVds - entered , starting logic to add VDS {0}", 
getVdsId());
-        do {
-            vds = TransactionSupport.executeInNewTransaction(new 
TransactionMethod<VDS>() {
-                @Override
-                public VDS runInTransaction() {
-                    return DbFacade.getInstance().getVdsDao().get(getVdsId());
-                }
-            });
-
-            if (vds == null) {
-                log.infoFormat(
-                        "AddVds - failed to get VDS by Id {0}, it was not yet 
added, going to sleep for 1.5 sec",
-                        getVdsId());
-                ThreadUtils.sleep(1500);
-            }
-        } while (vds == null);
+        VDS vds = DbFacade.getInstance().getVdsDao().get(getVdsId());
         log.infoFormat("AddVds - VDS {0} was added, will try to add it to the 
resource manager",
                 getVdsId());
         ResourceManager.getInstance().AddVds(vds, false);


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I070093a2afb352e635b07673b720f37a56d543fd
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Michael Kublin <mkub...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to