<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">the vlan id need to be validated, it
must be numeric and within 1 <= vlan id <= 4094.<br>
<br>
I dislike the UI design, please change it.<br>
<br>
<img src="cid:part1.09020104.01080304@linux.vnet.ibm.com" alt="">
<img src="cid:part2.04020306.00080501@linux.vnet.ibm.com" alt=""><br>
<br>
On 1/15/2014 7:57 AM, Aline Manera wrote:<br>
</div>
<blockquote
cite="mid:1389743877-13103-2-git-send-email-alinefm@linux.vnet.ibm.com"
type="cite">
<pre wrap="">From: Aline Manera <a class="moz-txt-link-rfc2396E" href="mailto:alinefm@br.ibm.com"><alinefm@br.ibm.com></a>
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 <a class="moz-txt-link-rfc2396E" href="mailto:alinefm@br.ibm.com"><alinefm@br.ibm.com></a>
---
ui/js/src/kimchi.network.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index 65479b2..eb64e03 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -136,12 +136,13 @@ 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")) {
+ data.vlan_id = network.vlan_id;
+ }
}
kimchi.createNetwork(data, function(result) {
network.state = result.state === "active" ? "up" : "down";
</pre>
</blockquote>
<br>
</body>
</html>