git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
====
[plcapi.git]
/
PLC
/
BootStates.py
diff --git
a/PLC/BootStates.py
b/PLC/BootStates.py
index
f1bfcf9
..
2bbcf0d
100644
(file)
--- a/
PLC/BootStates.py
+++ b/
PLC/BootStates.py
@@
-4,8
+4,6
@@
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id$
-#
from PLC.Faults import *
from PLC.Parameter import Parameter
from PLC.Faults import *
from PLC.Parameter import Parameter
@@
-25,16
+23,16
@@
class BootState(Row):
}
def validate_boot_state(self, name):
}
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"
if not len(name):
raise PLCInvalidArgument, "Boot state must be specified"
-
-
# Make sure boot state does not alre
dy exist
- conflicts = BootStates(self.api, [name])
+
+
# Make sure boot state does not alrea
dy exist
+
conflicts = BootStates(self.api, [name])
if conflicts:
raise PLCInvalidArgument, "Boot state name already in use"
if conflicts:
raise PLCInvalidArgument, "Boot state name already in use"
- return name
+
return name
class BootStates(Table):
"""
class BootStates(Table):
"""
@@
-46,8
+44,8
@@
class BootStates(Table):
sql = "SELECT %s FROM boot_states" % \
", ".join(BootState.fields)
sql = "SELECT %s FROM boot_states" % \
", ".join(BootState.fields)
-
+
if boot_states:
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)
self.selectall(sql)