- make Add() calling convention consistent among all functions that
[plcapi.git] / PLC / NodeGroups.py
index c43c940..4ccf4b8 100644 (file)
@@ -4,7 +4,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: NodeGroups.py,v 1.12 2006/10/06 19:05:31 mlhuang Exp $
+# $Id: NodeGroups.py,v 1.13 2006/10/20 17:50:33 mlhuang Exp $
 #
 
 from types import StringTypes
@@ -27,18 +27,15 @@ class NodeGroup(Row):
     join_tables = ['nodegroup_node', 'conf_file_nodegroup']
     fields = {
         'nodegroup_id': Parameter(int, "Node group identifier"),
-        'name': Parameter(str, "Node group name", max = 50),
+        'name': Parameter(str, "Node group name", max = 50, optional = False),
         'description': Parameter(str, "Node group description", max = 200),
         'node_ids': Parameter([int], "List of nodes in this node group"),
         'conf_file_ids': Parameter([int], "List of configuration files specific to this node group"),
         }
 
     def validate_name(self, name):
-       # Remove leading and trailing spaces
-       name = name.strip()
-
-       # Make sure name is not blank after we removed the spaces
-        if not len(name) > 0:
+       # Make sure name is not blank
+        if not len(name):
                 raise PLCInvalidArgument, "Invalid node group name"
        
        # Make sure node group does not alredy exist