def _env_root(repo, saltenv):
 if (saltenv == 'base'):
  trunk = os.path.join(repo['repo'], repo['trunk'])
  if os.path.isdir(trunk):
   return trunk
  else:
   return None
 branches = os.path.join(repo['repo'], repo['branches'])
 if (os.path.isdir(branches) and (saltenv in os.listdir(branches))):
  return os.path.join(branches, saltenv)
 tags = os.path.join(repo['repo'], repo['tags'])
 if (os.path.isdir(tags) and (saltenv in os.listdir(tags))):
  return os.path.join(tags, saltenv)
 return None

def _env_root ( repo , saltenv ) : if ( saltenv == 'base' ) : trunk = os . path . join ( repo [ 'repo' ] , repo [ 'trunk' ] ) if os . path . isdir ( trunk ) : return trunk else : return None branches = os . path . join ( repo [ 'repo' ] , repo [ 'branches' ] ) if ( os . path . isdir ( branches ) and ( saltenv in os . listdir ( branches ) ) ) : return os . path . join ( branches , saltenv ) tags = os . path . join ( repo [ 'repo' ] , repo [ 'tags' ] ) if ( os . path . isdir ( tags ) and ( saltenv in os . listdir ( tags ) ) ) : return os . path . join ( tags , saltenv ) return None
return the root of the directory corresponding to the desired environment .