From f33f00dd690e8bcd8df9c6a542c35844a6a9aa8a Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Mon, 6 Oct 2008 18:45:40 +0000 Subject: [PATCH] admins can now update the site_id. This should make it easier to move nodes to different sites --- PLC/Methods/UpdateNode.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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] -- 2.43.0