X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FBootStates.py;h=416ca4d48f767203eb5ce2032ca8d2e9c351ff4d;hb=50081fe11fb0d7510607a544a22c597f805ed5f0;hp=42a5214d97a24f57c95907c206d55a47fa0229b1;hpb=619bbb1a7acb1fcbd68567529913b120678ecc1b;p=plcapi.git diff --git a/PLC/BootStates.py b/PLC/BootStates.py index 42a5214..416ca4d 100644 --- a/PLC/BootStates.py +++ b/PLC/BootStates.py @@ -4,7 +4,8 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: BootStates.py,v 1.6 2006/10/24 20:02:22 mlhuang Exp $ +# $Id$ +# $URL$ # from PLC.Faults import * @@ -25,16 +26,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 alredy exist + conflicts = BootStates(self.api, [name]) if conflicts: raise PLCInvalidArgument, "Boot state name already in use" - return name + return name class BootStates(Table): """ @@ -46,7 +47,7 @@ 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))