def _find_domains(config, installer): if config.domains: domains = config.domains else: domains = display_ops.choose_names(installer) if not domains: raise errors.Error("Please specify --domains, or --installer that " "will help in domain names autodiscovery") return domains
def _find_domains_or_certname(config, installer): """Retrieve domains and certname from config or user input. """ domains = None if config.domains: domains = config.domains elif not config.certname: domains = display_ops.choose_names(installer) if not domains and not config.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, config.certname
def _find_domains_or_certname(config, installer, question=None): """Retrieve domains and certname from config or user input. :param config: Configuration object :type config: interfaces.IConfig :param installer: Installer object :type installer: interfaces.IInstaller :param `str` question: Overriding dialog question to ask the user if asked to choose from domain names. :returns: Two-part tuple of domains and certname :rtype: `tuple` of list of `str` and `str` :raises errors.Error: Usage message, if parameters are not used correctly """ domains = None certname = config.certname # first, try to get domains from the config if config.domains: domains = config.domains # if we can't do that but we have a certname, get the domains # with that certname elif certname: domains = cert_manager.domains_for_certname(config, certname) # that certname might not have existed, or there was a problem. # try to get domains from the user. if not domains: domains = display_ops.choose_names(installer, question) 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): """Retrieve domains and certname from config or user input. """ domains = None certname = config.certname # first, try to get domains from the config if config.domains: domains = config.domains # if we can't do that but we have a certname, get the domains # with that certname elif certname: domains = cert_manager.domains_for_certname(config, certname) # that certname might not have existed, or there was a problem. # try to get domains from the user. 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 _call(cls, installer, question=None): from certbot.display.ops import choose_names return choose_names(installer, question)
def _call(cls, installer): from certbot.display.ops import choose_names return choose_names(installer)