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
running accessors before db not working (misses admin account)
[plcapi.git]
/
PLC
/
BootStates.py
diff --git
a/PLC/BootStates.py
b/PLC/BootStates.py
index
952a2d5
..
416ca4d
100644
(file)
--- a/
PLC/BootStates.py
+++ b/
PLC/BootStates.py
@@
-26,16
+26,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 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"
if conflicts:
raise PLCInvalidArgument, "Boot state name already in use"
- return name
+
return name
class BootStates(Table):
"""
class BootStates(Table):
"""
@@
-47,7
+47,7
@@
class BootStates(Table):
sql = "SELECT %s FROM boot_states" % \
", ".join(BootState.fields)
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))
if boot_states:
sql += " WHERE boot_state IN (%s)" % ", ".join(map(api.db.quote, boot_states))