X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FBootStates.py;h=2bbcf0de3f8e125edb2f9e7b01eeecada6b97467;hb=9aecb8c6fde06136bef94e2fd6fce832dc3c0c10;hp=952a2d5f7d8735cab4a6af571f773115a46f4349;hpb=f5cd72e35593c96b9996ab4e49674cccc7525c48;p=plcapi.git diff --git a/PLC/BootStates.py b/PLC/BootStates.py index 952a2d5..2bbcf0d 100644 --- a/PLC/BootStates.py +++ b/PLC/BootStates.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 BootState(Row): } def validate_boot_state(self, name): - # Make sure name is not blank + # Make sure name is not blank if not len(name): raise PLCInvalidArgument, "Boot state must be specified" - - # Make sure boot state does not alredy exist - conflicts = BootStates(self.api, [name]) + + # Make sure boot state does not already exist + conflicts = BootStates(self.api, [name]) if conflicts: raise PLCInvalidArgument, "Boot state name already in use" - return name + return name class BootStates(Table): """ @@ -47,8 +44,8 @@ class BootStates(Table): sql = "SELECT %s FROM boot_states" % \ ", ".join(BootState.fields) - + if boot_states: - sql += " WHERE boot_state IN (%s)" % ", ".join(map(api.db.quote, boot_states)) + sql += " WHERE boot_state IN (%s)" % ", ".join( [ api.db.quote (s) for s in boot_states ] ) self.selectall(sql)