Ravi Nori has uploaded a new change for review.

Change subject: restapi : version values for hosts are wrong for libvirt
......................................................................

restapi : version values for hosts are wrong for libvirt

When a new host is added to engine and the status is either
installing for rebooting the libvirt version is unknown and
is reported as -1.

This patch supresses the libvirt version from /api/hosts if the
version is unknown.

Change-Id: I0c0525b6bb8c90d2ce4e10ac4f5c26f1a1b1e6b0
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=904935
Signed-off-by: Ravi Nori <[email protected]>
---
M 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostMapper.java
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/08/11808/1

diff --git 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostMapper.java
 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostMapper.java
index 5a0c5d4..e720290 100644
--- 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostMapper.java
+++ 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostMapper.java
@@ -272,7 +272,11 @@
                 * BYTES_IN_MEGABYTE));
         model.setMaxSchedulingMemory((int) entity.getMaxSchedulingMemory() * 
BYTES_IN_MEGABYTE);
 
-        if (entity.getlibvirt_version() != null) {
+        if (entity.getlibvirt_version() != null &&
+                entity.getlibvirt_version().getMajor() != -1 &&
+                entity.getlibvirt_version().getMinor() != -1 &&
+                entity.getlibvirt_version().getRevision() != -1 &&
+                entity.getlibvirt_version().getBuild() != -1) {
             Version version = new Version();
             version.setMajor(entity.getlibvirt_version().getMajor());
             version.setMinor(entity.getlibvirt_version().getMinor());


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

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

Reply via email to