Maor Lipchuk has uploaded a new change for review.

Change subject: core: Sync OVF tar file with unregistered entities
......................................................................

core: Sync OVF tar file with unregistered entities

Change-Id: Icc5fc1c1b704ecbb49fe3d4c2561ec1836093369
Signed-off-by: Maor Lipchuk <mlipc...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessOvfUpdateForStorageDomainCommand.java
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/45/32745/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessOvfUpdateForStorageDomainCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessOvfUpdateForStorageDomainCommand.java
index affe0f1..5d53ace 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessOvfUpdateForStorageDomainCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessOvfUpdateForStorageDomainCommand.java
@@ -24,6 +24,7 @@
 import org.ovirt.engine.core.common.action.VdcActionType;
 import org.ovirt.engine.core.common.action.VdcReturnValueBase;
 import org.ovirt.engine.core.common.businessentities.DiskImage;
+import org.ovirt.engine.core.common.businessentities.OvfEntityData;
 import org.ovirt.engine.core.common.businessentities.StorageDomain;
 import org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo;
 import 
org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfoStatus;
@@ -171,6 +172,7 @@
 
                 List<Pair<Guid, String>> ovfs =
                         
getVmAndTemplatesGenerationsDao().loadOvfDataForIds(idsToProcess);
+                addUnregisteredEntities(ovfs);
                 if (!ovfs.isEmpty()) {
                     buildFilesForOvfs(ovfs, inMemoryTar);
                 }
@@ -183,6 +185,14 @@
         return bufferedOutputStream.toByteArray();
     }
 
+    private void addUnregisteredEntities(List<Pair<Guid, String>> ovfs) {
+        List<OvfEntityData> ovfList = 
getUnregisteredOVFDataDao().getAllForStorageDomainByEntityType(getParameters().getStorageDomainId(),
 null);
+        for (OvfEntityData ovfEntityData : ovfList) {
+            Pair<Guid, String> ovfData = new 
Pair<>(ovfEntityData.getEntityId(), ovfEntityData.getOvfData());
+            ovfs.add(ovfData);
+        }
+    }
+
     protected void updateOvfStoreContent() {
         if (domainOvfStoresInfoForUpdate.isEmpty()) {
             return;


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

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

Reply via email to