def _handle_identical_cert_request(config, lineage):
 if (not lineage.ensure_deployed()):
  return ('reinstall', lineage)
 if renewal.should_renew(config, lineage):
  return ('renew', lineage)
 if config.reinstall:
  return ('reinstall', lineage)
 question = "You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.{br}(ref: {0}){br}{br}What would you like to do?".format(lineage.configfile.filename, br=os.linesep)
 if (config.verb == 'run'):
  keep_opt = 'Attempt to reinstall this existing certificate'
 elif (config.verb == 'certonly'):
  keep_opt = 'Keep the existing certificate for now'
 choices = [keep_opt, 'Renew & replace the cert (limit ~5 per 7 days)']
 display = zope.component.getUtility(interfaces.IDisplay)
 response = display.menu(question, choices, 'OK', 'Cancel', default=0, force_interactive=True)
 if (response[0] == display_util.CANCEL):
  raise errors.Error('User chose to cancel the operation and may reinvoke the client.')
 elif (response[1] == 0):
  return ('reinstall', lineage)
 elif (response[1] == 1):
  return ('renew', lineage)
 else:
  assert False, 'This is impossible'

def _handle_identical_cert_request ( config , lineage ) : if ( not lineage . ensure_deployed ( ) ) : return ( 'reinstall' , lineage ) if renewal . should_renew ( config , lineage ) : return ( 'renew' , lineage ) if config . reinstall : return ( 'reinstall' , lineage ) question = "You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.{br}(ref: {0}){br}{br}What would you like to do?" . format ( lineage . configfile . filename , br = os . linesep ) if ( config . verb == 'run' ) : keep_opt = 'Attempt to reinstall this existing certificate' elif ( config . verb == 'certonly' ) : keep_opt = 'Keep the existing certificate for now' choices = [ keep_opt , 'Renew & replace the cert (limit ~5 per 7 days)' ] display = zope . component . getUtility ( interfaces . IDisplay ) response = display . menu ( question , choices , 'OK' , 'Cancel' , default = 0 , force_interactive = True ) if ( response [ 0 ] == display_util . CANCEL ) : raise errors . Error ( 'User chose to cancel the operation and may reinvoke the client.' ) elif ( response [ 1 ] == 0 ) : return ( 'reinstall' , lineage ) elif ( response [ 1 ] == 1 ) : return ( 'renew' , lineage ) else : assert False , 'This is impossible'
figure out what to do if a lineage has the same names as a previously obtained one .