def set_remote_url(git_path, module, repo, dest, remote):
 remote_url = get_remote_url(git_path, module, dest, remote)
 if ((remote_url == repo) or (remote_url == unfrackgitpath(repo))):
  return False
 command = [git_path, 'remote', 'set-url', remote, repo]
 (rc, out, err) = module.run_command(command, cwd=dest)
 if (rc != 0):
  label = ('set a new url %s for %s' % (repo, remote))
  module.fail_json(msg=('Failed to %s: %s %s' % (label, out, err)))
 return (remote_url is not None)

def set_remote_url ( git_path , module , repo , dest , remote ) : remote_url = get_remote_url ( git_path , module , dest , remote ) if ( ( remote_url == repo ) or ( remote_url == unfrackgitpath ( repo ) ) ) : return False command = [ git_path , 'remote' , 'set-url' , remote , repo ] ( rc , out , err ) = module . run_command ( command , cwd = dest ) if ( rc != 0 ) : label = ( 'set a new url %s for %s' % ( repo , remote ) ) module . fail_json ( msg = ( 'Failed to %s: %s %s' % ( label , out , err ) ) ) return ( remote_url is not None )
updates repo from remote sources .