Ravi Nori has uploaded a new change for review.

Change subject: engine, webadmin: Edit Approve Host popup -> Cluster not updated
......................................................................

engine, webadmin: Edit Approve Host popup -> Cluster not updated

The host cluster is not updated in the
"Edit Approve Host" dialog.

For oVirt node the cpu flags is null, so
GetHostArchitectureQuery throws a NPE.

When cpu flags is null, ArchitectureType.unknown
is returned and the webadmin displays all clusters
for data center if unknown is returned.

Change-Id: I4b0357f07de5ac27902ceb250b7ef4c2e1642d08
Bug-Url: https://bugzilla.redhat.com/1056998
Signed-off-by: Ravi Nori <rn...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetHostArchitectureQuery.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
2 files changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/31/25031/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetHostArchitectureQuery.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetHostArchitectureQuery.java
index 1b79f7c..c7e810e 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetHostArchitectureQuery.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetHostArchitectureQuery.java
@@ -1,5 +1,6 @@
 package org.ovirt.engine.core.bll;
 
+import org.ovirt.engine.core.common.businessentities.ArchitectureType;
 import org.ovirt.engine.core.common.businessentities.ServerCpu;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.queries.IdQueryParameters;
@@ -18,6 +19,6 @@
                 
CpuFlagsManagerHandler.FindMaxServerCpuByFlags(host.getCpuFlags(),
                         host.getVdsGroupCompatibilityVersion());
 
-        getQueryReturnValue().setReturnValue(sc.getArchitecture());
+        getQueryReturnValue().setReturnValue(sc == null ? 
ArchitectureType.undefined : sc.getArchitecture());
     }
 }
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
index ec8c5d4..b290c24 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostModel.java
@@ -1222,7 +1222,8 @@
                                     ArrayList<VDSGroup> filteredClusters = new 
ArrayList<VDSGroup>();
 
                                     for (VDSGroup cluster : clusters) {
-                                        if (cluster.getArchitecture() == 
ArchitectureType.undefined
+                                        if (architecture == 
ArchitectureType.undefined
+                                                || cluster.getArchitecture() 
== ArchitectureType.undefined
                                                 || cluster.getArchitecture() 
== architecture) {
                                             filteredClusters.add(cluster);
                                         }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b0357f07de5ac27902ceb250b7ef4c2e1642d08
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
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