Yaniv Bronhaim has uploaded a new change for review.

Change subject: Adding host to DB before calling provision
......................................................................

Adding host to DB before calling provision

When calling provision foreman expect the engine's host-id to allow calling
the reinstallation after provisioning. Engine generates host-id while saving
host info to db, therefore this patch switches between the DB.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1158588
Change-Id: I635d87d09eec0dd052d86329d2b6b7f0a1658836
Signed-off-by: Yaniv Bronhaim <ybron...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
1 file changed, 11 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/98/34998/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
index 80a6e2f..d974b8b 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
@@ -106,6 +106,17 @@
             }
         }
 
+        TransactionSupport.executeInNewTransaction(new 
TransactionMethod<Void>() {
+            @Override
+            public Void runInTransaction() {
+                AddVdsStaticToDb();
+                AddVdsDynamicToDb();
+                AddVdsStatisticsToDb();
+                getCompensationContext().stateChanged();
+                return null;
+            }
+        });
+
         if (getParameters().getAddProvisioned()) {
             if (getParameters().getComputeResource() == null) {
                 log.errorFormat("Failed to provision: Compute resource cannot 
be empty");
@@ -132,17 +143,6 @@
             logable.addCustomValue("HostGroupName", 
getParameters().getHostGroup().getName());
             AuditLogDirector.log(logable, AuditLogType.VDS_PROVISION);
         }
-
-        TransactionSupport.executeInNewTransaction(new 
TransactionMethod<Void>() {
-            @Override
-            public Void runInTransaction() {
-                AddVdsStaticToDb();
-                AddVdsDynamicToDb();
-                AddVdsStatisticsToDb();
-                getCompensationContext().stateChanged();
-                return null;
-            }
-        });
 
         // set vds spm id
         if (getVdsGroup().getStoragePoolId() != null) {


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I635d87d09eec0dd052d86329d2b6b7f0a1658836
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Yaniv Bronhaim <ybron...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to