feat: Use databaseBackend config repace databaseEtcd

databaseBackend config contains type and url sub config, It can facilitate the expansion of other types of databases in the future.
This commit is contained in:
hudeng
2022-02-11 18:14:26 +08:00
committed by André Roth
parent f29449db14
commit 59bf4501e8
8 changed files with 47 additions and 13 deletions
+12 -3
View File
@@ -133,9 +133,17 @@ class BaseTest(object):
aptlyDir = ".aptly"
aptlyConfigFile = ".aptly.conf"
expectedCode = 0
databaseEtcd = os.environ.get("APTLY_ETCD_DATABASE")
if databaseEtcd is None:
databaseEtcd = ""
databaseType = os.environ.get("APTLY_DATABASE_TYPE")
databaseUrl = os.environ.get("APTLY_DATABASE_URL")
if databaseType is None:
databaseType = ""
if databaseUrl is None:
databaseUrl = ""
databaseBackend = {
"type": databaseType,
"url": databaseUrl,
}
configFile = {
"rootDir": f"{os.environ['HOME']}/{aptlyDir}",
@@ -157,6 +165,7 @@ class BaseTest(object):
"logFormat": "default",
"serveInAPIMode": True,
"databaseEtcd": databaseEtcd,
"databaseBackend": databaseBackend,
}
configOverride = {}
environmentOverride = {}
+2 -1
View File
@@ -30,5 +30,6 @@
"logLevel": "debug",
"logFormat": "default",
"serveInAPIMode": true,
"databaseEtcd": ""
"databaseEtcd": "",
"databaseBackend": {}
}
+2 -1
View File
@@ -30,5 +30,6 @@
"logLevel": "debug",
"logFormat": "default",
"serveInAPIMode": false,
"databaseEtcd": ""
"databaseEtcd": "",
"databaseBackend": {}
}