def _search_lineages(cli_config, func, initial_rv):
 configs_dir = cli_config.renewal_configs_dir
 util.make_or_verify_dir(configs_dir, mode=493, uid=os.geteuid())
 rv = initial_rv
 for renewal_file in storage.renewal_conf_files(cli_config):
  try:
   candidate_lineage = storage.RenewableCert(renewal_file, cli_config)
  except (errors.CertStorageError, IOError):
   logger.debug('Renewal conf file %s is broken. Skipping.', renewal_file)
   logger.debug('Traceback was:\n%s', traceback.format_exc())
   continue
  rv = func(candidate_lineage, rv)
 return rv

def _search_lineages ( cli_config , func , initial_rv ) : configs_dir = cli_config . renewal_configs_dir util . make_or_verify_dir ( configs_dir , mode = 493 , uid = os . geteuid ( ) ) rv = initial_rv for renewal_file in storage . renewal_conf_files ( cli_config ) : try : candidate_lineage = storage . RenewableCert ( renewal_file , cli_config ) except ( errors . CertStorageError , IOError ) : logger . debug ( 'Renewal conf file %s is broken. Skipping.' , renewal_file ) logger . debug ( 'Traceback was:\n%s' , traceback . format_exc ( ) ) continue rv = func ( candidate_lineage , rv ) return rv
iterate func over unbroken lineages .