Tal Nisan has uploaded a new change for review.

Change subject: webadmin: All LUNs appeared incorrecly under each target
......................................................................

webadmin: All LUNs appeared incorrecly under each target

Fixed a bug in which all LUNs in the host were appearing under each and
every target incorrectly

Change-Id: I9872cf89c49e64101005480d0c6363427e7072f2
Bug-Url: https://bugzilla.redhat.com/951928
Signed-off-by: Tal Nisan <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/SanStorageModel.java
1 file changed, 24 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/26/19026/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/SanStorageModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/SanStorageModel.java
index 4345e9b..290198c 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/SanStorageModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/SanStorageModel.java
@@ -225,25 +225,7 @@
         {
             if (a.getLunType() == getType() || a.getLunType() == 
StorageType.UNKNOWN)
             {
-                ArrayList<SanTargetModel> targets = new 
ArrayList<SanTargetModel>();
-
-                if (a.getLunConnections() != null)
-                {
-                    for (StorageServerConnections b : a.getLunConnections())
-                    {
-                        SanTargetModel tempVar = new SanTargetModel();
-                        tempVar.setAddress(b.getconnection());
-                        tempVar.setPort(b.getport());
-                        tempVar.setName(b.getiqn());
-                        tempVar.setIsSelected(true);
-                        tempVar.setIsLoggedIn(true);
-                        tempVar.setLuns(new ObservableCollection<LunModel>());
-                        SanTargetModel model = tempVar;
-                        model.getLoginCommand().setIsExecutionAllowed(false);
-
-                        targets.add(model);
-                    }
-                }
+                ArrayList<SanTargetModel> targets = createTargetModelList(a);
 
                 LunModel lunModel = new LunModel();
                 lunModel.setLunId(a.getLUN_id());
@@ -275,6 +257,28 @@
 
         initializeItems(newItems, null);
         proposeDiscover();
+    }
+
+    private ArrayList<SanTargetModel> createTargetModelList(LUNs a) {
+        ArrayList<SanTargetModel> targetModelList = new 
ArrayList<SanTargetModel>();
+        if (a.getLunConnections() != null)
+        {
+            for (StorageServerConnections b : a.getLunConnections())
+            {
+                SanTargetModel tempVar = new SanTargetModel();
+                tempVar.setAddress(b.getconnection());
+                tempVar.setPort(b.getport());
+                tempVar.setName(b.getiqn());
+                tempVar.setIsSelected(true);
+                tempVar.setIsLoggedIn(true);
+                tempVar.setLuns(new ObservableCollection<LunModel>());
+                SanTargetModel model = tempVar;
+                model.getLoginCommand().setIsExecutionAllowed(false);
+
+                targetModelList.add(model);
+            }
+        }
+        return targetModelList;
     }
 
     private void updateGrayedOut(LunModel lunModel) {
@@ -430,7 +434,7 @@
                     currLun.setProductId(lun.getProductId());
                     currLun.setSerial(lun.getSerial());
                     currLun.setMultipathing(lun.getMultipathing());
-                    currLun.setTargets((ArrayList) targets);
+                    currLun.setTargets(createTargetModelList((LUNs) 
lun.getEntity()));
                     currLun.setSize(lun.getSize());
                     currLun.setIsAccessible(lun.getIsAccessible());
                     currLun.setStatus(lun.getStatus());


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

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

Reply via email to