X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FNetworkMethods.py;h=4a68297fe330722f5955b85d15a13899492567f8;hb=f7ce7ce813d4c44502629820a3583f32a99a98f7;hp=c6f5864fccb0f9249cd8b0e7fd281d1b8152a43b;hpb=9a608e111c7f8182f51753ea3f563ebc19eb4c71;p=plcapi.git diff --git a/PLC/NetworkMethods.py b/PLC/NetworkMethods.py index c6f5864..4a68297 100644 --- a/PLC/NetworkMethods.py +++ b/PLC/NetworkMethods.py @@ -26,16 +26,16 @@ class NetworkMethod(Row): } 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): """ @@ -47,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))