git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
09ff846
)
- fixed NodeGroup.delete function
author
Tony Mack
<tmack@cs.princeton.edu>
Wed, 13 Sep 2006 15:40:26 +0000
(15:40 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Wed, 13 Sep 2006 15:40:26 +0000
(15:40 +0000)
PLC/NodeGroups.py
patch
|
blob
|
history
diff --git
a/PLC/NodeGroups.py
b/PLC/NodeGroups.py
index
1a02200
..
0e8b233
100644
(file)
--- a/
PLC/NodeGroups.py
+++ b/
PLC/NodeGroups.py
@@
-4,7
+4,7
@@
# 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: NodeGroups.py,v 1.
4 2006/09/12 16:08:50
tmack Exp $
+# $Id: NodeGroups.py,v 1.
5 2006/09/12 18:04:02
tmack Exp $
#
from types import StringTypes
#
from types import StringTypes
@@
-161,7
+161,7
@@
class NodeGroup(Row):
"""
assert 'nodegroup_id' in self
"""
assert 'nodegroup_id' in self
-
+ assert self is not {}
# Delete ourself
tables = ['nodegroup_nodes', 'override_bootscripts',
'conf_assoc', 'node_root_access']
# Delete ourself
tables = ['nodegroup_nodes', 'override_bootscripts',
'conf_assoc', 'node_root_access']
@@
-174,8
+174,8
@@
class NodeGroup(Row):
for table in tables:
self.api.db.do("DELETE FROM %s" \
for table in tables:
self.api.db.do("DELETE FROM %s" \
- " WHERE nodegroup_id = %
(nodegroup_id)
" % \
-
table
, self)
+ " WHERE nodegroup_id = %
d
" % \
+
(table, self['nodegroup_id'])
, self)
if commit:
self.api.db.commit()
if commit:
self.api.db.commit()