def eval_master_func(opts):
 if ('__master_func_evaluated' not in opts):
  mod_fun = opts['master']
  (mod, fun) = mod_fun.split('.')
  try:
   master_mod = salt.loader.raw_mod(opts, mod, fun)
   if (not master_mod):
    raise KeyError
   opts['master'] = master_mod[mod_fun]()
   if ((not isinstance(opts['master'], str)) and (not isinstance(opts['master'], list))):
    raise TypeError
   opts['__master_func_evaluated'] = True
  except KeyError:
   log.error('Failed to load module {0}'.format(mod_fun))
   sys.exit(salt.defaults.exitcodes.EX_GENERIC)
  except TypeError:
   log.error('{0} returned from {1} is not a string or a list'.format(opts['master'], mod_fun))
   sys.exit(salt.defaults.exitcodes.EX_GENERIC)
  log.info('Evaluated master from module: {0}'.format(mod_fun))

def eval_master_func ( opts ) : if ( '__master_func_evaluated' not in opts ) : mod_fun = opts [ 'master' ] ( mod , fun ) = mod_fun . split ( '.' ) try : master_mod = salt . loader . raw_mod ( opts , mod , fun ) if ( not master_mod ) : raise KeyError opts [ 'master' ] = master_mod [ mod_fun ] ( ) if ( ( not isinstance ( opts [ 'master' ] , str ) ) and ( not isinstance ( opts [ 'master' ] , list ) ) ) : raise TypeError opts [ '__master_func_evaluated' ] = True except KeyError : log . error ( 'Failed to load module {0}' . format ( mod_fun ) ) sys . exit ( salt . defaults . exitcodes . EX_GENERIC ) except TypeError : log . error ( '{0} returned from {1} is not a string or a list' . format ( opts [ 'master' ] , mod_fun ) ) sys . exit ( salt . defaults . exitcodes . EX_GENERIC ) log . info ( 'Evaluated master from module: {0}' . format ( mod_fun ) )
evaluate master function if master type is func and save it result in opts[master] .