[Kimchi-devel] [PATCH V2] [Kimchi 2/2] Fixed issue #1076 s390x : n/w shows twice same interface while adding for template

rajgupta at linux.vnet.ibm.com rajgupta at linux.vnet.ibm.com
Wed Nov 9 06:31:26 UTC 2016


From: Rajat Gupta <rajat.triumph at gmail.com>

    fixed issue #1076 s390x : while editing template and adding an interface,
    drop down for Network should show unique interfaces no repeats.

Signed-off-by: Rajat Gupta <rajat.triumph at gmail.com>
---
 ui/js/src/kimchi.template_edit_main.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index 9992c93..b0889e8 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -558,8 +558,9 @@ kimchi.template_edit_main = function() {
                         for (var i = 0; i < origmacvtapNetworks.length; i++) {
                             if (networkName === origmacvtapNetworks[i].name) {
                                 networkOptions += '<option selected="selected">' + origmacvtapNetworks[i].name + '</option>';
+                            }else{
+                                networkOptions += '<option>' + origmacvtapNetworks[i].name + '</option>';
                             }
-                            networkOptions += '<option>' + origmacvtapNetworks[i].name + '</option>';
                         }
                         $('select', '#form-template-interface-s390x #networkID' + networkItemNum + ' span.network').append(networkOptions);
 
@@ -576,8 +577,9 @@ kimchi.template_edit_main = function() {
                         for (var i = 0; i < origovsNetworks.length; i++) {
                             if (networkName === origovsNetworks[i]) {
                                 networkOptions += '<option selected="selected">' + origovsNetworks[i] + '</option>';
+                            }else{
+                                networkOptions += '<option>' + origovsNetworks[i] + '</option>';
                             }
-                            networkOptions += '<option>' + origovsNetworks[i] + '</option>';
                         }
                         $('select', '#form-template-interface-s390x #networkID' + networkItemNum + ' span.network').append(networkOptions);
 
@@ -591,8 +593,7 @@ kimchi.template_edit_main = function() {
                         for (var i = 0; i < result.length; i++) {
                             if (networkName === result[i].name) {
                                 networkOptions += '<option selected="selected">' + result[i].name + '</option>';
-                            }
-                            if (result[i].state === "active" && networkName !== result[i].name) {
+                            }else if (result[i].state === "active") {
                                 networkOptions += '<option>' + result[i].name + '</option>';
                             }
                         }
-- 
2.1.0




More information about the Kimchi-devel mailing list