def setenv(environ, false_unsets=False, clear_all=False, update_minion=False, permanent=False):
    ret = {}
    if not isinstance(environ, dict):
        log.debug(
            '{0}: \'environ\' argument is not a dict: \'{1}\''
            .format(__name__, environ)
        )
        return False
    if clear_all is True:
        # Unset any keys not defined in 'environ' dict supplied by user
        to_unset = [key for key in os.environ if key not in environ]
        for key in to_unset:
            ret[key] = setval(key, False, false_unsets, permanent=permanent)
    for key, val in six.iteritems(environ):
        if isinstance(val, six.string_types):
            ret[key] = setval(key, val, permanent=permanent)
        elif val is False:
            ret[key] = setval(key, val, false_unsets, permanent=permanent)
        else:
            log.debug(
                '{0}: \'val\' argument for key \'{1}\' is not a string '
                'or False: \'{2}\''
                .format(__name__, key, val)
            )
            return False

    if update_minion is True:
        __salt__['event.fire']({'environ': environ,
                                'false_unsets': false_unsets,
                                'clear_all': clear_all,
                                'permanent': permanent
                                },
                               'environ_setenv')
    return ret
Set multiple salt process environment variables from a dict.
dataset/ETHPy150Open saltstack/salt/salt/modules/environ.py/setenv