Alona Kaplan has uploaded a new change for review.

Change subject: webadmin: Vlan device is sent twice for SetupNetwork command
......................................................................

webadmin: Vlan device is sent twice for SetupNetwork command

If vlan device with the same name as the new device already exists,
the new one should replace it (and not add both of them).

Change-Id: I0e444ea3064ea6fd6a1187e1e009e2ef6d2d54c6
Bug-Url: https://bugzilla.redhat.com/919052
Signed-off-by: Alona Kaplan <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkOperation.java
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/10/12910/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkOperation.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkOperation.java
index f39c4b0..9ba84a1 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkOperation.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkOperation.java
@@ -1,6 +1,7 @@
 package org.ovirt.engine.ui.uicommonweb.models.hosts.network;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 import 
org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface;
@@ -112,6 +113,15 @@
                     }
                     VdsNetworkInterface vlanBridge = 
networkToAttach.attach(targetNic, true);
                     if (vlanBridge != null) {
+                        Iterator<VdsNetworkInterface> i = allNics.iterator();
+                        // If a vlan device with the same name as the new one 
already exists- remove it
+                        while (i.hasNext()) {
+                            VdsNetworkInterface nic = i.next();
+                            if (nic.getName().equals(vlanBridge.getName())) {
+                                i.remove();
+                                break;
+                            }
+                        }
                         allNics.add(vlanBridge);
                     }
                 }


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

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

Reply via email to