Skip to content
Snippets Groups Projects
Commit d35638f2 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

SW-772: only read rabbitmq credentials on production/test

parent 8172038d
No related branches found
No related tags found
1 merge request!8Cobalt2 multithreading fix
...@@ -10,15 +10,19 @@ DEFAULT_BROKER = "scu001.control.lofar" if isProductionEnvironment() else \ ...@@ -10,15 +10,19 @@ DEFAULT_BROKER = "scu001.control.lofar" if isProductionEnvironment() else \
DEFAULT_PORT = 5675 if isProductionEnvironment() or isTestEnvironment() else 5672 DEFAULT_PORT = 5675 if isProductionEnvironment() or isTestEnvironment() else 5672
# import the user and password from RabbitMQ 'db'credentials DEFAULT_USER = "guest"
try: DEFAULT_PASSWORD = "guest"
from lofar.common.dbcredentials import DBCredentials
_db_creds = DBCredentials().get("RabbitMQ") if isProductionEnvironment() or isTestEnvironment():
DEFAULT_USER = _db_creds.user # import the user and password from RabbitMQ 'db'credentials
DEFAULT_PASSWORD = _db_creds.password try:
except: from lofar.common.dbcredentials import DBCredentials
DEFAULT_USER = "guest" _db_creds = DBCredentials().get("RabbitMQ")
DEFAULT_PASSWORD = "guest" DEFAULT_USER = _db_creds.user
DEFAULT_PASSWORD = _db_creds.password
except:
pass
# default exchange to use for publishing messages # default exchange to use for publishing messages
DEFAULT_BUSNAME = adaptNameToEnvironment("lofar") DEFAULT_BUSNAME = adaptNameToEnvironment("lofar")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment