[autotest] Let TKO parser always talk to global database

In order to have the test results of distributed moblabs in one
central place, the TKO parser must always talk to the global
database, not to the local one that the local AFE and scheduler_db
are talking to.

This adds a second database configuration to the global_config and
makes the TKO parser always use that one.

BUG=None
DEPLOY=tko
TEST=Ran suites.

Change-Id: I613fd393e2d9d26c36e77c81badb86b589fd980e
Reviewed-on: https://chromium-review.googlesource.com/213259
Tested-by: Jakob Jülich <jakobjuelich@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Jakob Jülich <jakobjuelich@chromium.org>
diff --git a/tko/db.py b/tko/db.py
index 2ba4fe9..bdce8c7 100644
--- a/tko/db.py
+++ b/tko/db.py
@@ -44,29 +44,30 @@
         if host:
             self.host = host
         else:
-            self.host = get_value("AUTOTEST_WEB", "host")
+            self.host = get_value("AUTOTEST_WEB", "global_db_host")
         if database:
             self.database = database
         else:
-            self.database = get_value("AUTOTEST_WEB", "database")
+            self.database = get_value("AUTOTEST_WEB", "global_db_database")
 
         # grab the user and password
         if user:
             self.user = user
         else:
-            self.user = get_value("AUTOTEST_WEB", "user")
+            self.user = get_value("AUTOTEST_WEB", "global_db_user")
         if password is not None:
             self.password = password
         else:
-            self.password = get_value("AUTOTEST_WEB", "password")
+            self.password = get_value("AUTOTEST_WEB", "global_db_password")
 
         # grab the timeout configuration
-        self.query_timeout = get_value("AUTOTEST_WEB", "query_timeout",
+        self.query_timeout = get_value("AUTOTEST_WEB",
+                                       "global_db_query_timeout",
                                        type=int, default=3600)
-        self.min_delay = get_value("AUTOTEST_WEB", "min_retry_delay", type=int,
-                                   default=20)
-        self.max_delay = get_value("AUTOTEST_WEB", "max_retry_delay", type=int,
-                                   default=60)
+        self.min_delay = get_value("AUTOTEST_WEB", "global_db_min_retry_delay",
+                                   type=int, default=20)
+        self.max_delay = get_value("AUTOTEST_WEB", "global_db_max_retry_delay",
+                                   type=int, default=60)
 
 
     def _init_db(self):
@@ -552,7 +553,7 @@
 def _get_db_type():
     """Get the database type name to use from the global config."""
     get_value = global_config.global_config.get_config_value
-    return "db_" + get_value("AUTOTEST_WEB", "db_type", default="mysql")
+    return "db_" + get_value("AUTOTEST_WEB", "global_db_type", default="mysql")
 
 
 def _get_error_class(class_name):