def _resolve_symlink(path, max_depth=64):
 if (sys.getwindowsversion().major < 6):
  raise SaltInvocationError('Symlinks are only supported on Windows Vista or later.')
 paths_seen = set((path,))
 cur_depth = 0
 while is_link(path):
  path = readlink(path)
  if (path in paths_seen):
   raise CommandExecutionError('The given path is involved in a symlink loop.')
  paths_seen.add(path)
  cur_depth += 1
  if (cur_depth > max_depth):
   raise CommandExecutionError('Too many levels of symbolic links.')
 return path

def _resolve_symlink ( path , max_depth = 64 ) : if ( sys . getwindowsversion ( ) . major < 6 ) : raise SaltInvocationError ( 'Symlinks are only supported on Windows Vista or later.' ) paths_seen = set ( ( path , ) ) cur_depth = 0 while is_link ( path ) : path = readlink ( path ) if ( path in paths_seen ) : raise CommandExecutionError ( 'The given path is involved in a symlink loop.' ) paths_seen . add ( path ) cur_depth += 1 if ( cur_depth > max_depth ) : raise CommandExecutionError ( 'Too many levels of symbolic links.' ) return path
resolves the given symlink path to its real path .