# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id$
+# $URL$
#
from PLC.Faults import *
}
def validate_type(self, name):
- # Make sure name is not blank
+ # Make sure name is not blank
if not len(name):
raise PLCInvalidArgument, "Network type must be specified"
-
- # Make sure network type does not alredy exist
- conflicts = NetworkTypes(self.api, [name])
+
+ # Make sure network type does not alredy exist
+ conflicts = NetworkTypes(self.api, [name])
if conflicts:
raise PLCInvalidArgument, "Network type name already in use"
- return name
+ return name
class NetworkTypes(Table):
"""
sql = "SELECT %s FROM network_types" % \
", ".join(NetworkType.fields)
-
+
if types:
sql += " WHERE type IN (%s)" % ", ".join(map(api.db.quote, types))