def _find_lineage_for_domains_and_certname(config, domains, certname):
 if (not certname):
  return _find_lineage_for_domains(config, domains)
 else:
  lineage = cert_manager.lineage_for_certname(config, certname)
  if lineage:
   if domains:
    if (set(cert_manager.domains_for_certname(config, certname)) != set(domains)):
     _ask_user_to_confirm_new_names(config, domains, certname, lineage.names())
     return ('renew', lineage)
   return _handle_identical_cert_request(config, lineage)
  elif domains:
   return ('newcert', None)
  else:
   raise errors.ConfigurationError('No certificate with name {0} found. Use -d to specify domains, or run certbot --certificates to see possible certificate names.'.format(certname))

def _find_lineage_for_domains_and_certname ( config , domains , certname ) : if ( not certname ) : return _find_lineage_for_domains ( config , domains ) else : lineage = cert_manager . lineage_for_certname ( config , certname ) if lineage : if domains : if ( set ( cert_manager . domains_for_certname ( config , certname ) ) != set ( domains ) ) : _ask_user_to_confirm_new_names ( config , domains , certname , lineage . names ( ) ) return ( 'renew' , lineage ) return _handle_identical_cert_request ( config , lineage ) elif domains : return ( 'newcert' , None ) else : raise errors . ConfigurationError ( 'No certificate with name {0} found. Use -d to specify domains, or run certbot --certificates to see possible certificate names.' . format ( certname ) )
find appropriate lineage based on given domains and/or certname .