X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FNetworkMethods.py;h=4a68297fe330722f5955b85d15a13899492567f8;hb=981421fbc4d90301b4d1866f2695684ad4b7d616;hp=41ccfabc28c36b14f7abcf2b6ce28b6301824d4a;hpb=a74854dd38cb742b8fdc0d0cda7fff738a95312c;p=plcapi.git diff --git a/PLC/NetworkMethods.py b/PLC/NetworkMethods.py index 41ccfab..4a68297 100644 --- a/PLC/NetworkMethods.py +++ b/PLC/NetworkMethods.py @@ -5,6 +5,7 @@ # Copyright (C) 2006 The Trustees of Princeton University # # $Id$ +# $URL$ # from PLC.Faults import * @@ -19,22 +20,22 @@ class NetworkMethod(Row): table_name = 'network_methods' primary_key = 'method' - join_tables = ['nodenetworks'] + join_tables = ['interfaces'] fields = { 'method': Parameter(str, "Network method", max = 20), } def validate_method(self, name): - # Make sure name is not blank + # Make sure name is not blank if not len(name): raise PLCInvalidArgument, "Network method must be specified" - - # Make sure network method does not alredy exist - conflicts = NetworkMethods(self.api, [name]) + + # Make sure network method does not alredy exist + conflicts = NetworkMethods(self.api, [name]) if conflicts: raise PLCInvalidArgument, "Network method name already in use" - return name + return name class NetworkMethods(Table): """ @@ -46,7 +47,7 @@ class NetworkMethods(Table): sql = "SELECT %s FROM network_methods" % \ ", ".join(NetworkMethod.fields) - + if methods: sql += " WHERE method IN (%s)" % ", ".join(map(api.db.quote, methods))