From: Tony Mack Date: Mon, 6 Oct 2008 18:45:40 +0000 (+0000) Subject: admins can now update the site_id. This should make it easier to move nodes to differ... X-Git-Tag: PLCAPI-4.3-2~23 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f33f00dd690e8bcd8df9c6a542c35844a6a9aa8a;p=plcapi.git admins can now update the site_id. This should make it easier to move nodes to different sites --- diff --git a/PLC/Methods/UpdateNode.py b/PLC/Methods/UpdateNode.py index d5cdb0d..1e41b65 100644 --- 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', - 'key', 'session', 'boot_nonce'] + \ + 'key', 'session', 'boot_nonce', 'site_id'] + \ 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): - 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']: - 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]