Added checking to RPC modify_host() to fail if locking/unlocking has
been requested on an already locked/unlocked host. Updated frontend
doctests.
Visibility: Since this RPC seems to be used only by the CLI (the web
interface uses modify_hosts() RPC) the change will be visible to the CLI
when you try to lock/unlock hosts that are already locked/unlocked.
Signed-off-by: Mihai Rusu <dizzy@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3705 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py
index e730883..21e4d5a 100644
--- a/frontend/afe/rpc_interface.py
+++ b/frontend/afe/rpc_interface.py
@@ -115,7 +115,9 @@
def modify_host(id, **data):
rpc_utils.check_modify_host(data)
- models.Host.smart_get(id).update_object(data)
+ host = models.Host.smart_get(id)
+ rpc_utils.check_modify_host_locking(host, data)
+ host.update_object(data)
def modify_hosts(host_filter_data, update_data):