def saltenviron(environ):
    if '__opts__' not in locals():
        import salt.config
        __opts__ = salt.config.client_config(
                os.environ.get('SALT_MASTER_CONFIG', '/etc/salt/master'))

    environ['SALT_OPTS'] = __opts__
    environ['SALT_APIClient'] = salt.netapi.NetapiClient(__opts__)
Make Salt's opts dict and the APIClient available in the WSGI environ
dataset/ETHPy150Open saltstack/salt/salt/netapi/rest_wsgi.py/saltenviron