Added ability to lock/unlock machines from the AFE Host List view
Risk: low
Visibility: medium (UI change)
Signed-off-by: James Ren <jamesren@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3150 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py
index 1f68b19..3895190 100644
--- a/frontend/afe/rpc_interface.py
+++ b/frontend/afe/rpc_interface.py
@@ -112,6 +112,16 @@
models.Host.smart_get(id).update_object(data)
+def modify_hosts(host_filter_data, update_data):
+ """
+ @param host_filter_data filters out which hosts to modify
+ @param update_data dictionary with the changes to make to the hosts
+ """
+ hosts = models.Host.query_objects(host_filter_data)
+ for host in hosts:
+ host.update_object(update_data)
+
+
def host_add_labels(id, labels):
labels = models.Label.smart_get_bulk(labels)
models.Host.smart_get(id).labels.add(*labels)