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:
c1aaaec
)
admins can now update the site_id. This should make it easier to move nodes to differ...
author
Tony Mack
<tmack@cs.princeton.edu>
Mon, 6 Oct 2008 18:45:40 +0000
(18:45 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Mon, 6 Oct 2008 18:45:40 +0000
(18:45 +0000)
PLC/Methods/UpdateNode.py
patch
|
blob
|
history
diff --git
a/PLC/Methods/UpdateNode.py
b/PLC/Methods/UpdateNode.py
index
d5cdb0d
..
1e41b65
100644
(file)
--- a/
PLC/Methods/UpdateNode.py
+++ b/
PLC/Methods/UpdateNode.py
@@
-7,7
+7,7
@@
from PLC.Auth import Auth
related_fields = Node.related_fields.keys()
can_update = lambda (field, value): field in \
['hostname', 'boot_state', 'model', 'version',
related_fields = Node.related_fields.keys()
can_update = lambda (field, value): field in \
['hostname', 'boot_state', 'model', 'version',
- 'key', 'session', 'boot_nonce'] + \
+ 'key', 'session', 'boot_nonce'
, 'site_id'
] + \
related_fields
class UpdateNode(Method):
related_fields
class UpdateNode(Method):
@@
-35,11
+35,12
@@
class UpdateNode(Method):
returns = Parameter(int, '1 if successful')
def call(self, auth, node_id_or_hostname, node_fields):
returns = Parameter(int, '1 if successful')
def call(self, auth, node_id_or_hostname, node_fields):
- node_fields = dict(filter(can_update, node_fields.items()))
+
+ node_fields = dict(filter(can_update, node_fields.items()))
# Remove admin only fields
if 'admin' not in self.caller['roles']:
# Remove admin only fields
if 'admin' not in self.caller['roles']:
- for key in 'key', 'session', 'boot_nonce':
+ for key in 'key', 'session', 'boot_nonce'
, 'site_id'
:
if node_fields.has_key(key):
del node_fields[key]
if node_fields.has_key(key):
del node_fields[key]