Lior Vernia has uploaded a new change for review.

Change subject: webadmin: Remove properties from slaves without networks
......................................................................

webadmin: Remove properties from slaves without networks

Remove properties that could cause interface validation in backend,
such as IP address, boot protocol and so forth.

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/18/25018/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 059ec19..eae4bb3 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
@@ -170,6 +170,8 @@
 
                     nic1.getEntity().setBondName(bondName);
                     nic2.getEntity().setBondName(bondName);
+                    purgeBondSlave(nic1.getEntity());
+                    purgeBondSlave(nic2.getEntity());
                 }
             };
         }
@@ -209,6 +211,7 @@
 
                     for (NetworkInterfaceModel nic : nics) {
                         nic.getEntity().setBondName(bondName);
+                        purgeBondSlave(nic.getEntity());
                     }
                 }
             };
@@ -247,6 +250,7 @@
                     attachNetworks(bond, networksToReatach, allNics);
 
                     nic.getEntity().setBondName(bond.getEntity().getName());
+                    purgeBondSlave(nic.getEntity());
                 }
             };
         }
@@ -517,6 +521,13 @@
         networkToDetach.detach();
     }
 
+    private static void purgeBondSlave(VdsNetworkInterface iface) {
+        iface.setNetworkName(null);
+        iface.setAddress(null);
+        iface.setSubnet(null);
+        iface.setGateway(null);
+    }
+
     /**
      * Creates the Command for this Operation<BR>
      * The Command acts and on the specified Operands, and manipulates the 
provided nic list


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

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

Reply via email to