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

Aline Manera alinefm at linux.vnet.ibm.com
Thu Jun 12 20:58:37 UTC 2014


On 06/12/2014 08:19 AM, shaohef at linux.vnet.ibm.com wrote:
> 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) {

I agree with Cristian.
You should remove the whole line:

$("#networkName").toggleClass("invalid-field", 
!$("#networkName").val().match(/^[a-zA-Z0-9_]+$/));

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20140612/85df5a7b/attachment.html>


More information about the Kimchi-devel mailing list