Example #1
0
def requirement_available(requirement):
    """Checks if requirement can be imported.

    :rtype: bool
    :returns: ``True`` iff requirement can be imported

    """
    try:
        util.activate(requirement)
    except errors.DependencyError:  # pragma: no cover
        return False
    return True  # pragma: no cover
Example #2
0
def requirement_available(requirement):
    """Checks if requirement can be imported.

    :rtype: bool
    :returns: ``True`` iff requirement can be imported

    """
    try:
        util.activate(requirement)
    except errors.DependencyError:  # pragma: no cover
        return False
    return True  # pragma: no cover
Example #3
0
import logging
import os
import socket

import zope.component

from acme import errors as acme_errors
from acme import util as acme_util

from certbot import interfaces
from certbot import util

PSUTIL_REQUIREMENT = "psutil>=2.2.1"

try:
    acme_util.activate(PSUTIL_REQUIREMENT)
    import psutil  # pragma: no cover
    USE_PSUTIL = True
except acme_errors.DependencyError:  # pragma: no cover
    USE_PSUTIL = False

logger = logging.getLogger(__name__)

RENEWER_EXTRA_MSG = (
    " For automated renewal, you may want to use a script that stops"
    " and starts your webserver. You can find an example at"
    " https://certbot.eff.org/docs/using.html#renewal ."
    " Alternatively you can use the webroot plugin to renew without"
    " needing to stop and start your webserver.")

Example #4
0
 def _call(cls, *args, **kwargs):
     from acme.util import activate
     return activate(*args, **kwargs)
Example #5
0
import logging
import os
import socket

import zope.component

from acme import errors as acme_errors
from acme import util as acme_util

from certbot import interfaces
from certbot import util

PSUTIL_REQUIREMENT = "psutil>=2.2.1"

try:
    acme_util.activate(PSUTIL_REQUIREMENT)
    import psutil  # pragma: no cover
    USE_PSUTIL = True
except acme_errors.DependencyError:  # pragma: no cover
    USE_PSUTIL = False

logger = logging.getLogger(__name__)

RENEWER_EXTRA_MSG = (
    " For automated renewal, you may want to use a script that stops"
    " and starts your webserver. You can find an example at"
    " https://certbot.eff.org/docs/using.html#renewal ."
    " Alternatively you can use the webroot plugin to renew without"
    " needing to stop and start your webserver.")

Example #6
0
"""DNS Resolver for ACME client.
Required only for local validation of 'dns-01' challenges.
"""
import logging

from acme import errors
from acme import util

DNS_REQUIREMENT = 'dnspython>=1.12'

try:
    util.activate(DNS_REQUIREMENT)
    # pragma: no cover
    import dns.exception
    import dns.resolver
    DNS_AVAILABLE = True
except errors.DependencyError:  # pragma: no cover
    DNS_AVAILABLE = False


logger = logging.getLogger(__name__)


def txt_records_for_name(name):
    """Resolve the name and return the TXT records.

    :param unicode name: Domain name being verified.

    :returns: A list of txt records, if empty the name could not be resolved
    :rtype: list of unicode