X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FNetworkTypes.py;h=eb34e7c9b1d96201c206fca390c05aead51533f9;hb=19d4a01ccf66af9e00914351b3eacd5fc880f988;hp=2b5ff4dd77d61fd314a0fece758420b18bfc6038;hpb=f5cd72e35593c96b9996ab4e49674cccc7525c48;p=plcapi.git diff --git a/PLC/NetworkTypes.py b/PLC/NetworkTypes.py index 2b5ff4dd..eb34e7c9 100644 --- a/PLC/NetworkTypes.py +++ b/PLC/NetworkTypes.py @@ -4,9 +4,6 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id$ -# $URL$ -# from PLC.Faults import * from PLC.Parameter import Parameter @@ -26,16 +23,16 @@ class NetworkType(Row): } 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): """ @@ -47,8 +44,8 @@ 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)) + sql += " WHERE type IN (%s)" % ", ".join( [ api.db.quote (t) for t in types ] ) self.selectall(sql)