mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Improve method of grabbing Salt's config for the wsgi app interface
This commit is contained in:
parent
712af4c83c
commit
14821f6677
@ -39,6 +39,8 @@ An example Apache virtual host configuration::
|
||||
'''
|
||||
# pylint: disable=C0103
|
||||
|
||||
import os
|
||||
|
||||
import cherrypy
|
||||
|
||||
from . import app
|
||||
@ -47,9 +49,11 @@ def bootstrap_app():
|
||||
'''
|
||||
Grab the opts dict of the master config by trying to import Salt
|
||||
'''
|
||||
import salt.client
|
||||
opts = salt.client.LocalClient().opts
|
||||
return app.get_app(opts)
|
||||
import salt.config
|
||||
__opts__ = salt.config.client_config(
|
||||
os.environ.get('SALT_MASTER_CONFIG', '/etc/salt/master'))
|
||||
return app.get_app(__opts__)
|
||||
|
||||
|
||||
def get_application(*args):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user