def _find_domains_or_certname(config, installer):
 domains = None
 certname = config.certname
 if config.domains:
  domains = config.domains
 elif certname:
  domains = cert_manager.domains_for_certname(config, certname)
 if (not domains):
  domains = display_ops.choose_names(installer)
 if ((not domains) and (not certname)):
  raise errors.Error('Please specify --domains, or --installer that will help in domain names autodiscovery, or --cert-name for an existing certificate name.')
 return (domains, certname)

def _find_domains_or_certname ( config , installer ) : domains = None certname = config . certname if config . domains : domains = config . domains elif certname : domains = cert_manager . domains_for_certname ( config , certname ) if ( not domains ) : domains = display_ops . choose_names ( installer ) if ( ( not domains ) and ( not certname ) ) : raise errors . Error ( 'Please specify --domains, or --installer that will help in domain names autodiscovery, or --cert-name for an existing certificate name.' ) return ( domains , certname )
retrieve domains and certname from config or user input .