Add app var for init scripts location to access certs install

This commit is contained in:
Sam Chow 2018-07-10 11:43:34 -04:00
parent 01c23be9d6
commit bd54eacbad
8 changed files with 25 additions and 15 deletions

View file

@ -13,7 +13,7 @@ from flask import request, make_response, jsonify
import features
from app import app, avatar, superusers, authentication, config_provider
from app import app, avatar, superusers, authentication, config_provider, INIT_SCRIPTS_LOCATION
from auth import scopes
from auth.auth_context import get_authenticated_user
from auth.permissions import SuperUserPermission
@ -950,7 +950,7 @@ class SuperUserCustomCertificate(ApiResource):
# Call the update script to install the certificate immediately.
if not app.config['TESTING']:
logger.debug('Calling certs_install.sh')
if os.system('/conf/init/certs_install.sh') != 0:
if os.system(os.path.join(INIT_SCRIPTS_LOCATION, 'certs_install.sh')) != 0:
raise Exception('Could not install certificates')
logger.debug('certs_install.sh completed')