From 1167b07e0097b897afd1aef101ecb4a7ef4c73aa Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 14 Oct 2008 18:55:16 +0000 Subject: [PATCH] admins can now update the site_id. This should make it easier to move --- 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 d5cdb0d4..1e41b651 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.47.0