Roy Golan has uploaded a new change for review.

Change subject: webadmin: filter out unsupported architectures
......................................................................

webadmin: filter out unsupported architectures

unsupported architecture is one that doesn't have a configured cpu to
support it (its a vdc_options). Those archs are useless effectively so
no point showing them in the dropdown.

Change-Id: I7568e61882478f10bec614ddf514b32d23adc199
Signed-off-by: Roy Golan <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/78/26078/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java
index 31b833d..e2ea5a9 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/clusters/ClusterModel.java
@@ -2,7 +2,9 @@
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -1363,8 +1365,18 @@
                     AsyncDataProvider.isClusterEmpty(emptyQuery, 
clusterModel.getEntity().getId());
                 } else {
                     populateCPUList(clusterModel, cpus, true);
+                    filterUnsupportedArchs(clusterModel);
                 }
             }
+
+            private void filterUnsupportedArchs(ClusterModel clusterModel) {
+                Collection<ArchitectureType> archsWithSupportingCpus = new 
HashSet<ArchitectureType>();
+                archsWithSupportingCpus.add(ArchitectureType.undefined);
+                for (ServerCpu cpu: clusterModel.getCPU().getItems()) {
+                    archsWithSupportingCpus.add(cpu.getArchitecture());
+                }
+                
clusterModel.getArchitecture().setItems(archsWithSupportingCpus);
+            }
         };
         AsyncDataProvider.getCPUList(_asyncQuery, version);
 


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

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

Reply via email to