Merge pull request #2646 from Netflix/2636-config-ignore
Ensuring that configs passed via the command line are respected.
This commit is contained in:
commit
b5d255d7c9
|
@ -62,8 +62,8 @@ LEMUR_BLUEPRINTS = (
|
|||
)
|
||||
|
||||
|
||||
def create_app(config=None):
|
||||
app = factory.create_app(app_name=__name__, blueprints=LEMUR_BLUEPRINTS, config=config)
|
||||
def create_app(config_path=None):
|
||||
app = factory.create_app(app_name=__name__, blueprints=LEMUR_BLUEPRINTS, config=config_path)
|
||||
configure_hook(app)
|
||||
return app
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ from lemur.pending_certificates.models import PendingCertificate # noqa
|
|||
from lemur.dns_providers.models import DnsProvider # noqa
|
||||
|
||||
manager = Manager(create_app)
|
||||
manager.add_option('-c', '--config', dest='config')
|
||||
manager.add_option('-c', '--config', dest='config_path', required=False)
|
||||
|
||||
migrate = Migrate(create_app)
|
||||
|
||||
|
@ -391,7 +391,7 @@ class LemurServer(Command):
|
|||
# run startup tasks on an app like object
|
||||
validate_conf(current_app, REQUIRED_VARIABLES)
|
||||
|
||||
app.app_uri = 'lemur:create_app(config="{0}")'.format(current_app.config.get('CONFIG_PATH'))
|
||||
app.app_uri = 'lemur:create_app(config_path="{0}")'.format(current_app.config.get('CONFIG_PATH'))
|
||||
|
||||
return app.run()
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ def app(request):
|
|||
Creates a new Flask application for a test duration.
|
||||
Uses application factory `create_app`.
|
||||
"""
|
||||
_app = create_app(os.path.dirname(os.path.realpath(__file__)) + '/conf.py')
|
||||
_app = create_app(config_path=os.path.dirname(os.path.realpath(__file__)) + '/conf.py')
|
||||
ctx = _app.app_context()
|
||||
ctx.push()
|
||||
|
||||
|
|
Loading…
Reference in New Issue