Merge the two databases and the two Django projects. Note that the TKO migrations are still present, as is the migration code for TKO in database/migrate.py. These pieces of code are preserved because they are required by this change to perform the merge. A separate change will be submitted in the future to remove those references.

WARNING: This change will move all tables in TKO into the AUTOTEST_WEB database. Custom TKO tables that Autotest does not know about will NOT be moved, and will be lost after this change. Any scripts that run directly against the TKO database will cease functioning until they are modified to run against AUTOTEST_WEB. Additionally, if you were importing any .py files from autotest_lib.new_tko.tko.*, they have been moved to autotest_lib.frontend.tko.*

Notes: You will need to manually create two files after applying this patch
touch <autotest_dir>/frontend/tko/__init__.py
touch <autotest_dir>/tko/migrations/__init__.py
Optionally, you can also remove the entire <autotest_dir>/new_tko/ directory, as it is no longer needed.

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4106 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/tko/db.py b/tko/db.py
index 536e3cc..c170fe9 100644
--- a/tko/db.py
+++ b/tko/db.py
@@ -43,28 +43,28 @@
         if host:
             self.host = host
         else:
-            self.host = get_value("TKO", "host")
+            self.host = get_value("AUTOTEST_WEB", "host")
         if database:
             self.database = database
         else:
-            self.database = get_value("TKO", "database")
+            self.database = get_value("AUTOTEST_WEB", "database")
 
         # grab the user and password
         if user:
             self.user = user
         else:
-            self.user = get_value("TKO", "user")
+            self.user = get_value("AUTOTEST_WEB", "user")
         if password is not None:
             self.password = password
         else:
-            self.password = get_value("TKO", "password")
+            self.password = get_value("AUTOTEST_WEB", "password")
 
         # grab the timeout configuration
-        self.query_timeout = get_value("TKO", "query_timeout",
+        self.query_timeout = get_value("AUTOTEST_WEB", "query_timeout",
                                        type=int, default=3600)
-        self.min_delay = get_value("TKO", "min_retry_delay", type=int,
+        self.min_delay = get_value("AUTOTEST_WEB", "min_retry_delay", type=int,
                                    default=20)
-        self.max_delay = get_value("TKO", "max_retry_delay", type=int,
+        self.max_delay = get_value("AUTOTEST_WEB", "max_retry_delay", type=int,
                                    default=60)
 
 
@@ -515,7 +515,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("TKO", "db_type", default="mysql")
+    return "db_" + get_value("AUTOTEST_WEB", "db_type", default="mysql")
 
 
 def _get_error_class(class_name):