moblab: Add version information to the setup place to aid support.
Knowing the version number is important to be able to support
partner issues when running moblab.
BUG=chromium:631233
TEST=local
Change-Id: I63f205fc02505e963988a5a5ae0eeb5441ead7df
Reviewed-on: https://chromium-review.googlesource.com/391131
Commit-Ready: Keith Haddow <haddowk@chromium.org>
Tested-by: Keith Haddow <haddowk@chromium.org>
Reviewed-by: Keith Haddow <haddowk@chromium.org>
Reviewed-by: Michael Tang <ntang@chromium.org>
diff --git a/frontend/afe/moblab_rpc_interface.py b/frontend/afe/moblab_rpc_interface.py
index 3b5f9d0..9c1ae8e 100644
--- a/frontend/afe/moblab_rpc_interface.py
+++ b/frontend/afe/moblab_rpc_interface.py
@@ -450,3 +450,14 @@
return _create_operation_status_response(True, None)
+
+@rpc_utils.moblab_only
+def get_version_info():
+ """ RPC handler to get informaiton about the version of the moblab.
+ @return: A serialized JSON RPC object.
+ """
+ lines = open('/etc/lsb-release').readlines()
+ lines.remove('')
+ version_response = {x.split('=')[0]: x.split('=')[1] for x in lines}
+ return rpc_utils.prepare_for_serialization(version_response)
+