def master_config(path, env_var='SALT_MASTER_CONFIG', defaults=None, exit_on_config_errors=False):
 if (defaults is None):
  defaults = DEFAULT_MASTER_OPTS
 if (not os.environ.get(env_var, None)):
  salt_config_dir = os.environ.get('SALT_CONFIG_DIR', None)
  if salt_config_dir:
   env_config_file_path = os.path.join(salt_config_dir, 'master')
   if (salt_config_dir and os.path.isfile(env_config_file_path)):
    os.environ[env_var] = env_config_file_path
 overrides = load_config(path, env_var, DEFAULT_MASTER_OPTS['conf_file'])
 default_include = overrides.get('default_include', defaults['default_include'])
 include = overrides.get('include', [])
 overrides.update(include_config(default_include, path, verbose=False), exit_on_config_errors=exit_on_config_errors)
 overrides.update(include_config(include, path, verbose=True), exit_on_config_errors=exit_on_config_errors)
 opts = apply_master_config(overrides, defaults)
 _validate_opts(opts)
 if (opts.get('nodegroups') is None):
  opts['nodegroups'] = DEFAULT_MASTER_OPTS.get('nodegroups', {})
 if ((opts.get('transport') == 'raet') and ('aes' in opts)):
  opts.pop('aes')
 apply_sdb(opts)
 return opts

def master_config ( path , env_var = 'SALT_MASTER_CONFIG' , defaults = None , exit_on_config_errors = False ) : if ( defaults is None ) : defaults = DEFAULT_MASTER_OPTS if ( not os . environ . get ( env_var , None ) ) : salt_config_dir = os . environ . get ( 'SALT_CONFIG_DIR' , None ) if salt_config_dir : env_config_file_path = os . path . join ( salt_config_dir , 'master' ) if ( salt_config_dir and os . path . isfile ( env_config_file_path ) ) : os . environ [ env_var ] = env_config_file_path overrides = load_config ( path , env_var , DEFAULT_MASTER_OPTS [ 'conf_file' ] ) default_include = overrides . get ( 'default_include' , defaults [ 'default_include' ] ) include = overrides . get ( 'include' , [ ] ) overrides . update ( include_config ( default_include , path , verbose = False ) , exit_on_config_errors = exit_on_config_errors ) overrides . update ( include_config ( include , path , verbose = True ) , exit_on_config_errors = exit_on_config_errors ) opts = apply_master_config ( overrides , defaults ) _validate_opts ( opts ) if ( opts . get ( 'nodegroups' ) is None ) : opts [ 'nodegroups' ] = DEFAULT_MASTER_OPTS . get ( 'nodegroups' , { } ) if ( ( opts . get ( 'transport' ) == 'raet' ) and ( 'aes' in opts ) ) : opts . pop ( 'aes' ) apply_sdb ( opts ) return opts
return a masters configuration for the provided options and vm .