[autotest] Add server database to django model.
Server database is added to store information about servers running in an
Autotest instance. This is the first CL to implement it. Design doc:
go/chromeos-lab-serverdb-design
django model uses db_router to rout database calls to different database
connections:
local: All AFE table calls.
global: All TKO table calls.
readonly: Calls from web frontend.
This CL adds another router for all calls to server database to `server`.
DEPLOY=migrate_server_db
CQ-DEPEND=CL:230814
BUG=chromium:424778
TEST=unitest, part of the test is done by atest code that'll be in another cl.
Test server database migration:
./database/migrate.py sync 0 -d AUTOTEST_SERVER_DB
./database/migrate.py sync 1 -d AUTOTEST_SERVER_DB
./database/migrate.py sync 2 -d AUTOTEST_SERVER_DB
./database/migrate.py sync 3 -d AUTOTEST_SERVER_DB
python frontend/health/utils_unittest.py
Change-Id: I84be386c8f5b7efd53ae1ecbd6293eae4326f19f
Reviewed-on: https://chromium-review.googlesource.com/231671
Tested-by: Dan Shi <[email protected]>
Reviewed-by: Fang Deng <[email protected]>
Commit-Queue: Dan Shi <[email protected]>
diff --git a/client/common_lib/error.py b/client/common_lib/error.py
index 3428edd..3f975ea 100644
--- a/client/common_lib/error.py
+++ b/client/common_lib/error.py
@@ -649,6 +649,12 @@
pass
+class InvalidDataError(Exception):
+ """Exception raised when invalid data provided for database operation.
+ """
+ pass
+
+
# This MUST remain at the end of the file.
# Limit 'from error import *' to only import the exception instances.
for _name, _thing in locals().items():