Maor Lipchuk has uploaded a new change for review.

Change subject: core: Add log instead of comment in OvfDataUpdater.
......................................................................

core: Add log instead of comment in OvfDataUpdater.

Adding log when currentDbGeneration is null

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/14/28014/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/OvfDataUpdater.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/OvfDataUpdater.java
index 4b97a2e..80c434a 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/OvfDataUpdater.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/OvfDataUpdater.java
@@ -385,9 +385,11 @@
 
                 loadVmData(vm);
                 Long currentDbGeneration = 
getVmStaticDao().getDbGeneration(vm.getId());
-
-                // currentDbGeneration can be null in case that the vm was 
deleted during the run of OvfDataUpdater.
-                if (currentDbGeneration != null && 
vm.getStaticData().getDbGeneration() == currentDbGeneration) {
+                if (currentDbGeneration == null) {
+                    log.warnFormat("currentDbGeneration of VM (name: {0}, id: 
{1}) is null, probably because the VM was deleted during the run of 
OvfDataUpdater.",
+                            vm.getName(),
+                            vm.getId());
+                } else if (vm.getStaticData().getDbGeneration() == 
currentDbGeneration) {
                     
proccessedOvfConfigurationsInfo.add(buildMetadataDictionaryForVm(vm, 
vmsAndTemplateMetadata, vmImages));
                     proccessedIdsInfo.add(vm.getId());
                     
proccessedOvfGenerationsInfo.add(vm.getStaticData().getDbGeneration());


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94dd7e1f597771054ab2344179acf7cef6ab05d2
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