[autotest] Move get_global_afe_hostname to server/site_utils

Move get_global_afe_hostname to server/site_utils so that
other code can import it without django env setup hassle.

TEST=Run unittest, run shard_client
BUG=chromium:568873

Change-Id: I574d3dc00e2f79af0283487ec9cac6fb8bfd9fd4
Reviewed-on: https://chromium-review.googlesource.com/317276
Commit-Ready: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
diff --git a/frontend/afe/rpc_utils.py b/frontend/afe/rpc_utils.py
index b9a5106..f7f079a 100644
--- a/frontend/afe/rpc_utils.py
+++ b/frontend/afe/rpc_utils.py
@@ -1284,12 +1284,6 @@
     return label
 
 
-def get_global_afe_hostname():
-    """Read the hostname of the global AFE from the global configuration."""
-    return global_config.global_config.get_config_value(
-            'SERVER', 'global_afe_hostname')
-
-
 def route_rpc_to_master(func):
     """Route RPC to master AFE.
 
@@ -1343,7 +1337,7 @@
 
         if server_utils.is_shard():
             afe = frontend_wrappers.RetryingAFE(
-                    server=get_global_afe_hostname(),
+                    server=server_utils.get_global_afe_hostname(),
                     user=thread_local.get_user())
             return afe.run(func.func_name, **kwargs)
         return func(**kwargs)