Honor the results_storage_server parameter in moblab.

By default, the results_storage_server in global_config.ini is empty
now. Both lab and moblab could set the value and take effect. If not
set, the lab takes the original default value, and moblab takes the
image bucket uri.

BUG=chromium:621212
TEST=unit test.

Change-Id: Ifd712b53bcffa76af17db8cd4d87947323291b08
Reviewed-on: https://chromium-review.googlesource.com/356126
Commit-Ready: Michael Tang <ntang@chromium.org>
Tested-by: Michael Tang <ntang@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Michael Tang <ntang@chromium.org>
diff --git a/frontend/afe/site_rpc_interface.py b/frontend/afe/site_rpc_interface.py
index e8f8a4e..aecc1a1 100644
--- a/frontend/afe/site_rpc_interface.py
+++ b/frontend/afe/site_rpc_interface.py
@@ -548,7 +548,8 @@
     value =_CONFIG.get_config_value('CROS', _IMAGE_STORAGE_SERVER)
     if value is not None:
         cloud_storage_info[_IMAGE_STORAGE_SERVER] = value
-    value =_CONFIG.get_config_value('CROS', _RESULT_STORAGE_SERVER)
+    value = _CONFIG.get_config_value('CROS', _RESULT_STORAGE_SERVER,
+            default=None)
     if value is not None:
         cloud_storage_info[_RESULT_STORAGE_SERVER] = value
 
@@ -656,7 +657,8 @@
             valid, details = _is_valid_bucket_url(
                 key_id, key_secret, cloud_storage_info[_IMAGE_STORAGE_SERVER])
 
-        if valid:
+        # allows result bucket to be empty.
+        if valid and cloud_storage_info[_RESULT_STORAGE_SERVER]:
             valid, details = _is_valid_bucket_url(
                 key_id, key_secret, cloud_storage_info[_RESULT_STORAGE_SERVER])
     return (valid, details)