[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/server/site_utils.py b/server/site_utils.py
index 6d44467..52ab791 100644
--- a/server/site_utils.py
+++ b/server/site_utils.py
@@ -479,6 +479,12 @@
return bool(hostname)
+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 is_restricted_user(username):
"""Determines if a user is in a restricted group.