diff --git a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py index 275fc4921245badacd3ceb86fd7291f32062cbc4..43a7c7674b9666c27efe62c574796e425ef6e7ff 100644 --- a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py +++ b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py @@ -35,9 +35,14 @@ class RADBError(Exception): pass class RADatabase(PostgresDatabaseConnection): - def __init__(self, dbcreds: dbcredentials.DBCredentials, + def __init__(self, dbcreds: dbcredentials.DBCredentials=None, num_connect_retries: int=5, connect_retry_interval: float=1.0): + + if dbcreds is None: + dbcreds = dbcredentials.DBCredentials().get("RADB") + logger.info("Read default RADB dbcreds from disk: %s" % dbcreds.stringWithHiddenPassword()) + super().__init__(dbcreds=dbcreds, auto_commit_selects=False, num_connect_retries=num_connect_retries,