def remotes(cwd, user=None, password=None, redact_auth=True, ignore_retcode=False):
 cwd = _expand_path(cwd, user)
 command = ['git', 'remote', '--verbose']
 ret = {}
 output = _git_run(command, cwd=cwd, user=user, password=password, ignore_retcode=ignore_retcode)['stdout']
 for remote_line in salt.utils.itertools.split(output, '\n'):
  try:
   (remote, remote_info) = remote_line.split(None, 1)
  except ValueError:
   continue
  try:
   (remote_url, action) = remote_info.rsplit(None, 1)
  except ValueError:
   continue
  action = action.lstrip('(').rstrip(')').lower()
  if (action not in ('fetch', 'push')):
   log.warning("Unknown action '{0}' for remote '{1}' in git checkout located in {2}".format(action, remote, cwd))
   continue
  if redact_auth:
   remote_url = salt.utils.url.redact_http_basic_auth(remote_url)
  ret.setdefault(remote, {})[action] = remote_url
 return ret

def remotes ( cwd , user = None , password = None , redact_auth = True , ignore_retcode = False ) : cwd = _expand_path ( cwd , user ) command = [ 'git' , 'remote' , '--verbose' ] ret = { } output = _git_run ( command , cwd = cwd , user = user , password = password , ignore_retcode = ignore_retcode ) [ 'stdout' ] for remote_line in salt . utils . itertools . split ( output , '\n' ) : try : ( remote , remote_info ) = remote_line . split ( None , 1 ) except ValueError : continue try : ( remote_url , action ) = remote_info . rsplit ( None , 1 ) except ValueError : continue action = action . lstrip ( '(' ) . rstrip ( ')' ) . lower ( ) if ( action not in ( 'fetch' , 'push' ) ) : log . warning ( "Unknown action '{0}' for remote '{1}' in git checkout located in {2}" . format ( action , remote , cwd ) ) continue if redact_auth : remote_url = salt . utils . url . redact_http_basic_auth ( remote_url ) ret . setdefault ( remote , { } ) [ action ] = remote_url return ret
get fetch and push urls for each remote in a git checkout cwd the path to the git checkout user user under which to run the git command .