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

@ -11,7 +11,7 @@ from config_app.config_endpoints.exception import InvalidRequest
from config_app.config_endpoints.api import resource, ApiResource, nickname
from config_app.config_endpoints.api.superuser_models_pre_oci import pre_oci_model
from config_app.config_util.ssl import load_certificate, CertInvalidException
from config_app.c_app import app, config_provider
from config_app.c_app import config_provider, INIT_SCRIPTS_LOCATION
logger = logging.getLogger(__name__)
@ -51,7 +51,7 @@ class SuperUserCustomCertificate(ApiResource):
# TODO(QUAY-991): properly install the custom certs provided by user
# Call the update script with config dir location to install the certificate immediately.
if subprocess.call(['/quay-registry/config_app/init/certs_install.sh'],
if subprocess.call([os.path.join(INIT_SCRIPTS_LOCATION, 'certs_install.sh')],
env={ 'QUAYCONF': config_provider.get_config_dir_path() }) != 0:
raise Exception('Could not install certificates')