Moblab: Display 'moblab' user as default in AFE.
Currently there are 2 separate users for Moblab: 'default_user' for
kicking off jobs from the AFE and 'moblab' for kicking off jobs from
the run_suite command.
This change defaults the AFE to use 'moblab'. And allows jobs to be
aborted from the AFE.
BUG=chromium:358579
TEST=Moblab AFE defaults to 'moblab' user and is able to abort jobs
created by run_suite. Also verified get_current_board() still works
on a moblab.
Change-Id: Ic9a0a7bfc745a670796863629d070056e1dfd69f
Reviewed-on: https://chromium-review.googlesource.com/193657
Reviewed-by: Prashanth B <beeps@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
diff --git a/frontend/apache_auth.py b/frontend/apache_auth.py
index 4ed1471..8971f43 100644
--- a/frontend/apache_auth.py
+++ b/frontend/apache_auth.py
@@ -3,8 +3,10 @@
from django.contrib import auth
from django import http
+from autotest_lib.client.cros import constants
from autotest_lib.frontend import thread_local
from autotest_lib.frontend.afe import models, management
+from autotest_lib.server import utils
DEBUG_USER = 'debug_user'
@@ -61,7 +63,7 @@
user = request.META.get('HTTP_AUTHORIZATION')
if user is None:
# no user info - assume we're in development mode
- user = DEBUG_USER
+ user = constants.MOBLAB_USER if utils.is_moblab() else DEBUG_USER
thread_local.set_user(user)