def repo_exists(module, repodata, overwrite_multiple):
 existing_repos = _parse_repos(module)
 repos = []
 for kw in ['alias', 'url']:
  name = repodata[kw]
  for oldr in existing_repos:
   if ((repodata[kw] == oldr[kw]) and (oldr not in repos)):
    repos.append(oldr)
 if (len(repos) == 0):
  return (False, False, None)
 elif (len(repos) == 1):
  has_changes = _repo_changes(repos[0], repodata)
  return (True, has_changes, repos)
 elif (len(repos) >= 2):
  if overwrite_multiple:
   return (True, True, repos)
  else:
   errmsg = ('More than one repo matched "%s": "%s".' % (name, repos))
   errmsg += ' Use overwrite_multiple to allow more than one repo to be overwritten'
   module.fail_json(msg=errmsg)

def repo_exists ( module , repodata , overwrite_multiple ) : existing_repos = _parse_repos ( module ) repos = [ ] for kw in [ 'alias' , 'url' ] : name = repodata [ kw ] for oldr in existing_repos : if ( ( repodata [ kw ] == oldr [ kw ] ) and ( oldr not in repos ) ) : repos . append ( oldr ) if ( len ( repos ) == 0 ) : return ( False , False , None ) elif ( len ( repos ) == 1 ) : has_changes = _repo_changes ( repos [ 0 ] , repodata ) return ( True , has_changes , repos ) elif ( len ( repos ) >= 2 ) : if overwrite_multiple : return ( True , True , repos ) else : errmsg = ( 'More than one repo matched "%s": "%s".' % ( name , repos ) ) errmsg += ' Use overwrite_multiple to allow more than one repo to be overwritten' module . fail_json ( msg = errmsg )
check whether the repository already exists .