[Kimchi-devel] [PATCH] UI bug fix: Set vlan_id value only if 'Enable VLAN' is checked

Daniel H Barboza danielhb at linux.vnet.ibm.com
Fri Jan 10 17:22:41 UTC 2014


Reviewed-by: Daniel Barboza <danielhb at linux.vnet.ibm.com>


On 01/10/2014 02:33 PM, Aline Manera wrote:
> From: Aline Manera <alinefm at br.ibm.com>
>
> Commit 2f54aaba added a checkbox to provide choice of enabling vlan tagging
> while creating a bridged network, but it doesn't check the checkbox before
> setting the vlan_id to send server request.
>
> Because that when the user tries to create a bridged network without enabling
> VLAN the following error is raised:
> Invalid parameter: 'None is not of type u'integer''
>
> Fix it by setting vlan_id only if the vlan checkbox is checked.
>
> Signed-off-by: Aline Manera <alinefm at br.ibm.com>
> ---
>   ui/js/src/kimchi.network.js |    6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
> index 65479b2..9bd0cb5 100644
> --- a/ui/js/src/kimchi.network.js
> +++ b/ui/js/src/kimchi.network.js
> @@ -136,12 +136,14 @@ kimchi.initNetworkCreation = function() {
>               var data = {
>                   name : network.name,
>                   connection: network.type,
> -                vlan_id: network.vlan_id,
>               };
>               if (network.type === kimchi.NETWORK_TYPE_BRIDGE) {
>                   data.connection = "bridge";
>                   data.interface = network.interface;
> -                data.vlan_id = network.vlan_id;
> +                if ($("#enableVlan").prop("checked")) {
> +                    alert('está checked')
> +                    data.vlan_id = network.vlan_id;
> +                }
>               }
>               kimchi.createNetwork(data, function(result) {
>                   network.state = result.state === "active" ? "up" : "down";




More information about the Kimchi-devel mailing list