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

TMSS-1996: startup fix. This service needs to check both the django orm setup, and the rest client

parent 32dadabf
No related branches found
No related tags found
No related merge requests found
......@@ -78,11 +78,19 @@ def main():
group = OptionGroup(parser, 'Django options')
parser.add_option_group(group)
group.add_option('-C', '--credentials', dest='dbcredentials', type='string', default=os.environ.get('TMSS_DBCREDENTIALS', 'TMSSClient'), help='django rest api dbcredentials name, default: %default')
group.add_option('-R', '--tmss_client_credentials_id', dest='tmss_client_credentials_id', type='string', default='TMSSClient', help='TMSS django REST API credentials name, default: %default')
group.add_option('-C', '--credentials', dest='dbcredentials', type='string', default=os.environ.get('TMSS_DBCREDENTIALS', 'TMSS'), help='django dbcredentials name, default: %default')
(options, args) = parser.parse_args()
with create_service(options.exchange, options.broker, options.dbcredentials):
# check TMSS is up and running via the client
TMSSsession.check_connection_and_exit_on_error(options.tmss_client_credentials_id)
# setup/check the django ORM as well
from lofar.sas.tmss.tmss import setup_and_check_tmss_django_database_connection_and_exit_on_error
setup_and_check_tmss_django_database_connection_and_exit_on_error(options.dbcredentials)
with create_service(options.exchange, options.broker, options.tmss_client_credentials_id):
waitForInterrupt()
if __name__ == '__main__':
......
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