def _get_repo_options(**kwargs):
 fromrepo = kwargs.get('fromrepo', '')
 repo = kwargs.get('repo', '')
 disablerepo = kwargs.get('disablerepo', '')
 enablerepo = kwargs.get('enablerepo', '')
 if (repo and (not fromrepo)):
  fromrepo = repo
 ret = []
 if fromrepo:
  log.info("Restricting to repo '%s'", fromrepo)
  ret.extend(['--disablerepo=*', ('--enablerepo=' + fromrepo)])
 else:
  if disablerepo:
   targets = ([disablerepo] if (not isinstance(disablerepo, list)) else disablerepo)
   log.info('Disabling repo(s): %s', ', '.join(targets))
   ret.extend(['--disablerepo={0}'.format(x) for x in targets])
  if enablerepo:
   targets = ([enablerepo] if (not isinstance(enablerepo, list)) else enablerepo)
   log.info('Enabling repo(s): %s', ', '.join(targets))
   ret.extend(['--enablerepo={0}'.format(x) for x in targets])
 return ret

def _get_repo_options ( ** kwargs ) : fromrepo = kwargs . get ( 'fromrepo' , '' ) repo = kwargs . get ( 'repo' , '' ) disablerepo = kwargs . get ( 'disablerepo' , '' ) enablerepo = kwargs . get ( 'enablerepo' , '' ) if ( repo and ( not fromrepo ) ) : fromrepo = repo ret = [ ] if fromrepo : log . info ( "Restricting to repo '%s'" , fromrepo ) ret . extend ( [ '--disablerepo=*' , ( '--enablerepo=' + fromrepo ) ] ) else : if disablerepo : targets = ( [ disablerepo ] if ( not isinstance ( disablerepo , list ) ) else disablerepo ) log . info ( 'Disabling repo(s): %s' , ', ' . join ( targets ) ) ret . extend ( [ '--disablerepo={0}' . format ( x ) for x in targets ] ) if enablerepo : targets = ( [ enablerepo ] if ( not isinstance ( enablerepo , list ) ) else enablerepo ) log . info ( 'Enabling repo(s): %s' , ', ' . join ( targets ) ) ret . extend ( [ '--enablerepo={0}' . format ( x ) for x in targets ] ) return ret
return a list of tuples to seed the "env" list .