admins can now update the site_id. This should make it easier to move nodes to differ...
authorTony Mack <tmack@cs.princeton.edu>
Mon, 6 Oct 2008 18:45:40 +0000 (18:45 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 6 Oct 2008 18:45:40 +0000 (18:45 +0000)
PLC/Methods/UpdateNode.py

index d5cdb0d..1e41b65 100644 (file)
@@ -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]