original_docstring: 
          Programatically determine config value based on the desired saltenv
          
docstring: Programatically determine config value based on the desired saltenv
docstring_tokens: Programatically determine config value based on the desired saltenv
code: def add_conf_overlay(cls, name):
          '''
          Programatically determine config value based on the desired saltenv
          '''
          def _getconf(self, tgt_env='base'):
              strip_sep = lambda x: x.rstrip(os.sep) \
                  if name in ('root', 'mountpoint') \
                  else x
              if self.role != 'gitfs':
                  return strip_sep(getattr(self, '_' + name))
              # Get saltenv-specific configuration
              saltenv_conf = self.saltenv.get(tgt_env, {})
              if name == 'ref':
                  if tgt_env == 'base':
                      return self.base
                  else:
                      if name in saltenv_conf:
                          return saltenv_conf[name]
                      elif tgt_env in self.global_saltenv \
                              and name in self.global_saltenv[tgt_env]:
                          return self.global_saltenv[tgt_env][name]
                      else:
                          return tgt_env
              if name in saltenv_conf:
                  return strip_sep(saltenv_conf[name])
              elif tgt_env in self.global_saltenv \
                      and name in self.global_saltenv[tgt_env]:
                  return strip_sep(self.global_saltenv[tgt_env][name])
              else:
                  return strip_sep(getattr(self, '_' + name))
          setattr(cls, name, _getconf)
code_tokens: def add_conf_overlay ( cls , name ) : def _getconf ( self , tgt_env = 'base' ) : strip_sep = lambda x : x . rstrip ( os . sep ) if name in ( 'root' , 'mountpoint' ) else x if self . role != 'gitfs' : return strip_sep ( getattr ( self , '_' + name ) ) saltenv_conf = self . saltenv . get ( tgt_env , { } ) if name == 'ref' : if tgt_env == 'base' : return self . base else : if name in saltenv_conf : return saltenv_conf [ name ] elif tgt_env in self . global_saltenv and name in self . global_saltenv [ tgt_env ] : return self . global_saltenv [ tgt_env ] [ name ] else : return tgt_env if name in saltenv_conf : return strip_sep ( saltenv_conf [ name ] ) elif tgt_env in self . global_saltenv and name in self . global_saltenv [ tgt_env ] : return strip_sep ( self . global_saltenv [ tgt_env ] [ name ] ) else : return strip_sep ( getattr ( self , '_' + name ) ) setattr ( cls , name , _getconf )
short_docstring: Programatically determine config value based on the desired saltenv
short_docstring_tokens: Programatically determine config value based on the desired saltenv
comment: '''
          Programatically determine config value based on the desired saltenv
          '''$SEP$# Get saltenv-specific configuration