def _get_certname(config, verb):
 certname = config.certname
 if (not certname):
  disp = zope.component.getUtility(interfaces.IDisplay)
  filenames = storage.renewal_conf_files(config)
  choices = [storage.lineagename_for_filename(name) for name in filenames]
  if (not choices):
   raise errors.Error('No existing certificates found.')
  (code, index) = disp.menu('Which certificate would you like to {0}?'.format(verb), choices, ok_label='Select', flag='--cert-name', force_interactive=True)
  if ((code != display_util.OK) or (not (index in range(0, len(choices))))):
   raise errors.Error('User ended interaction.')
  certname = choices[index]
 return certname

def _get_certname ( config , verb ) : certname = config . certname if ( not certname ) : disp = zope . component . getUtility ( interfaces . IDisplay ) filenames = storage . renewal_conf_files ( config ) choices = [ storage . lineagename_for_filename ( name ) for name in filenames ] if ( not choices ) : raise errors . Error ( 'No existing certificates found.' ) ( code , index ) = disp . menu ( 'Which certificate would you like to {0}?' . format ( verb ) , choices , ok_label = 'Select' , flag = '--cert-name' , force_interactive = True ) if ( ( code != display_util . OK ) or ( not ( index in range ( 0 , len ( choices ) ) ) ) ) : raise errors . Error ( 'User ended interaction.' ) certname = choices [ index ] return certname
get certname from flag .