From: Tony Mack <tmack@cs.princeton.edu>
Date: Fri, 11 May 2007 20:22:55 +0000 (+0000)
Subject: - do not allow bwlimit values under 500000
X-Git-Tag: PLCAPI-4.2-0~130
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=50b5e3df1e68dd79876aec2a0da620a50fffd369;p=plcapi.git

- do not allow bwlimit values under 500000
---

diff --git a/PLC/NodeNetworks.py b/PLC/NodeNetworks.py
index 8733f8d3..a25c366c 100644
--- a/PLC/NodeNetworks.py
+++ b/PLC/NodeNetworks.py
@@ -4,7 +4,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: NodeNetworks.py,v 1.15 2006/11/09 19:43:55 mlhuang Exp $
+# $Id: NodeNetworks.py,v 1.16 2006/11/25 09:41:14 thierry Exp $
 #
 
 from types import StringTypes
@@ -109,6 +109,15 @@ class NodeNetwork(Row):
     validate_dns1 = validate_ip
     validate_dns2 = validate_ip
 
+    def validate_bwlimit(self, bwlimit):
+	if not bwlimit:
+	    return bwlimit
+
+	if bwlimit < 500000:
+	    raise PLCInvalidArgument, 'Minimum bw is 500 kbs'
+
+	return bwlimit	
+
     def validate_hostname(self, hostname):
         # Optional
         if not hostname: