Ravi Nori has uploaded a new change for review.

Change subject: engine: version values for hosts are wrong
......................................................................

engine: version values for hosts are wrong

When the host is being installed or is being rebooted
the version value is unknow and is initialized to -1.
Displaying this in the /api/hosts xml results in schema
validation errors.

This patch supresses the version information if it is
unknown.

Change-Id: Ib6cf8f5480b29e07b60f36465b8fa0db74ee5246
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=891301
Signed-off-by: Ravi Nori <rn...@redhat.com>
---
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/87/10687/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 fadc09e..f782ca5 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
@@ -213,7 +213,11 @@
         sm.setPriority(entity.getVdsSpmPriority());
         sm.setValue(entity.getspm_status() == VdsSpmStatus.SPM);
         model.setStorageManager(sm);
-        if (entity.getVersion() != null) {
+        if (entity.getVersion() != null &&
+                entity.getVersion().getMajor() != -1 &&
+                entity.getVersion().getMinor() != -1 &&
+                entity.getVersion().getRevision() != -1 &&
+                entity.getVersion().getBuild() != -1) {
             Version version = new Version();
             version.setMajor(entity.getVersion().getMajor());
             version.setMinor(entity.getVersion().getMinor());


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

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

Reply via email to