mirror of
https://github.com/certbot/certbot.git
synced 2026-06-04 14:26:10 -04:00
Ensure the correct dbm module is used for all envs
This commit is contained in:
parent
ba9de53768
commit
35c0d79390
3 changed files with 14 additions and 3 deletions
|
|
@ -138,8 +138,8 @@ def certid_sha1_hex(cert_path):
|
|||
"""
|
||||
sha1_hex = binascii.hexlify(certid_sha1(cert_path))
|
||||
if isinstance(sha1_hex, six.binary_type):
|
||||
return sha1_hex.decode('utf-8')
|
||||
return sha1_hex
|
||||
return sha1_hex.decode('utf-8') # pragma: no cover
|
||||
return sha1_hex # pragma: no cover
|
||||
|
||||
|
||||
def certid_sha1(cert_path):
|
||||
|
|
|
|||
|
|
@ -39,6 +39,12 @@ from certbot_apache import tls_sni_01
|
|||
|
||||
from collections import defaultdict
|
||||
|
||||
try:
|
||||
import dbm.ndbm as dbm # pragma: no cover
|
||||
except ImportError: # pragma: no cover
|
||||
# dbm.ndbm only available on Python3
|
||||
import dbm # pragma: no cover
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
"""Test for certbot_apache.configurator OCSP Prefetching functionality"""
|
||||
import dbm
|
||||
import os
|
||||
import unittest
|
||||
import mock
|
||||
|
|
@ -8,6 +7,12 @@ import six # pylint: disable=unused-import
|
|||
|
||||
from certbot_apache.tests import util
|
||||
|
||||
try:
|
||||
import dbm.ndbm as dbm # pragma: no cover
|
||||
except ImportError: # pragma: no cover
|
||||
# dbm.ndbm only available on Python3
|
||||
import dbm # pragma: no cover
|
||||
|
||||
|
||||
class OCSPPrefetchTest(util.ApacheTest):
|
||||
"""Tests for OCSP Prefetch feature"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue