wip test template for bec_config.yaml resolution
This commit is contained in:
@@ -1,11 +1,15 @@
|
|||||||
"""
|
"""
|
||||||
Pre-startup script for BEC client. This script is executed before the BEC client
|
Pre-startup script for BEC client. This script is executed before the BEC client
|
||||||
is started. It can be used to add additional command line arguments.
|
is started. It can be used to add additional command line arguments.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import csaxs_bec
|
|
||||||
from bec_lib.service_config import ServiceConfig
|
from bec_lib.service_config import ServiceConfig
|
||||||
|
|
||||||
|
import csaxs_bec
|
||||||
|
|
||||||
|
|
||||||
def extend_command_line_args(parser):
|
def extend_command_line_args(parser):
|
||||||
"""
|
"""
|
||||||
Extend the command line arguments of the BEC client.
|
Extend the command line arguments of the BEC client.
|
||||||
@@ -20,10 +24,9 @@ def get_config() -> ServiceConfig:
|
|||||||
"""
|
"""
|
||||||
Create and return the service configuration.
|
Create and return the service configuration.
|
||||||
"""
|
"""
|
||||||
path = os.path.dirname(csaxs_bec.__file__)
|
deployment_path = os.path.dirname(os.path.dirname(csaxs_bec.__file__))
|
||||||
if path.startswith('/data/test/x12sa-test-bec/production'):
|
files = os.listdir(deployment_path)
|
||||||
return ServiceConfig(redis={"host": "x12sa-bec-001", "port": 6379})
|
if "bec_config.yaml" in files:
|
||||||
elif path.startswith('/data/test/x12sa-test-bec/test'):
|
return ServiceConfig(config_path=os.path.join(deployment_path, "bec_config.yaml"))
|
||||||
return ServiceConfig(redis={"host": "x12sa-bec-002", "port": 6379})
|
|
||||||
else:
|
else:
|
||||||
return ServiceConfig(redis={"host": "localhost", "port": 6379})
|
return ServiceConfig(redis={"host": "localhost", "port": 6379})
|
||||||
|
|||||||
Reference in New Issue
Block a user