[Kimchi-devel] [PATCH] bug fix: accept '-' & '_' for network name.

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Thu Jun 12 11:19:02 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

Both '-' and '_' are allowed by libvirt,  so we should not put extra
restrictions.

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.network.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index 23930cd..c6e828d 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -321,7 +321,7 @@ kimchi.cleanNetworkDialog = function() {
 
 kimchi.setupNetworkFormEvent = function() {
     $("#networkName").on("keyup", function(event) {
-        $("#networkName").toggleClass("invalid-field", !$("#networkName").val().match(/^[a-zA-Z0-9_]+$/));
+        $("#networkName").toggleClass("invalid-field", !$("#networkName").val().match(/^[\-\w]+$/));
         kimchi.updateNetworkFormButton();
     });
     $("#networkTypeIso").on("click", function(event) {
-- 
1.9.3




More information about the Kimchi-devel mailing list