Added Retry Count
This commit is contained in:
parent
ac1b84a842
commit
4bb1c7931d
4 changed files with 21 additions and 8 deletions
|
|
@ -33,6 +33,7 @@ class ContainerEnv:
|
|||
"server": os.getenv("EASYHAPROXY_CERTBOT_SERVER", False),
|
||||
"eab_kid": os.getenv("EASYHAPROXY_CERTBOT_EAB_KID", ""),
|
||||
"eab_hmac_key": os.getenv("EASYHAPROXY_CERTBOT_EAB_HMAC_KEY", ""),
|
||||
"retry_count": int(os.getenv("EASYHAPROXY_CERTBOT_RETRY_COUNT", 60)),
|
||||
}
|
||||
|
||||
if env_vars["certbot"]["autoconfig"] != "" and not env_vars["certbot"]["server"] and env_vars["certbot"]["email"] != "":
|
||||
|
|
@ -260,6 +261,7 @@ class Certbot:
|
|||
self.eab_kid = self.set_eab_kid(env["certbot"]["eab_kid"])
|
||||
self.eab_hmac_key = self.set_eab_hmac_key(env["certbot"]["eab_hmac_key"])
|
||||
self.freeze_issue = {}
|
||||
self.retry_count = env["certbot"]["retry_count"]
|
||||
|
||||
@staticmethod
|
||||
def set_acme_server(acme_server):
|
||||
|
|
@ -395,5 +397,5 @@ class Certbot:
|
|||
host = host[3:]
|
||||
cert_status = self.get_certificate_status(host)
|
||||
if cert_status != "ok":
|
||||
self.freeze_issue[host] = 5
|
||||
self.freeze_issue[host] = self.retry_count
|
||||
Functions.log(Functions.CERTBOT_LOG, Functions.DEBUG, "Freeze issuing ssl for %s due failure. The certificate is %s" % (host, cert_status))
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ def test_container_env_empty():
|
|||
"eab_hmac_key": "",
|
||||
"eab_kid": "",
|
||||
"email": "",
|
||||
"server": False}
|
||||
"server": False,
|
||||
"retry_count": 60}
|
||||
} == ContainerEnv.read()
|
||||
|
||||
# os.environ['CERTBOT_LOG_LEVEL'] = 'warn'
|
||||
|
|
@ -29,7 +30,8 @@ def test_container_env_customerrors():
|
|||
"eab_hmac_key": "",
|
||||
"eab_kid": "",
|
||||
"email": "",
|
||||
"server": False}
|
||||
"server": False,
|
||||
"retry_count": 60}
|
||||
} == ContainerEnv.read()
|
||||
finally:
|
||||
os.environ['HAPROXY_CUSTOMERRORS'] = ''
|
||||
|
|
@ -46,7 +48,8 @@ def test_container_env_sslmode():
|
|||
"eab_hmac_key": "",
|
||||
"eab_kid": "",
|
||||
"email": "",
|
||||
"server": False}
|
||||
"server": False,
|
||||
"retry_count": 60}
|
||||
} == ContainerEnv.read()
|
||||
finally:
|
||||
os.environ['EASYHAPROXY_SSL_MODE'] = ''
|
||||
|
|
@ -64,7 +67,8 @@ def test_container_env_stats():
|
|||
"eab_hmac_key": "",
|
||||
"eab_kid": "",
|
||||
"email": "",
|
||||
"server": False}
|
||||
"server": False,
|
||||
"retry_count": 60}
|
||||
} == ContainerEnv.read()
|
||||
finally:
|
||||
os.environ['HAPROXY_USERNAME'] = ''
|
||||
|
|
@ -88,7 +92,8 @@ def test_container_env_stats_password():
|
|||
"eab_hmac_key": "",
|
||||
"eab_kid": "",
|
||||
"email": "",
|
||||
"server": False}
|
||||
"server": False,
|
||||
"retry_count": 60}
|
||||
} == ContainerEnv.read()
|
||||
finally:
|
||||
os.environ['HAPROXY_PASSWORD'] = ''
|
||||
|
|
@ -112,7 +117,8 @@ def test_container_env_stats_password_2():
|
|||
"eab_hmac_key": "",
|
||||
"eab_kid": "",
|
||||
"email": "",
|
||||
"server": False}
|
||||
"server": False,
|
||||
"retry_count": 60}
|
||||
} == ContainerEnv.read()
|
||||
finally:
|
||||
os.environ['HAPROXY_USERNAME'] = ''
|
||||
|
|
@ -132,7 +138,8 @@ def test_container_env_certbot_email():
|
|||
'eab_hmac_key': "",
|
||||
'eab_kid': "",
|
||||
"email": "acme@example.org",
|
||||
"server": False
|
||||
"server": False,
|
||||
"retry_count": 60
|
||||
}
|
||||
} == ContainerEnv.read()
|
||||
finally:
|
||||
|
|
@ -144,6 +151,7 @@ def test_container_env_certbot_full():
|
|||
os.environ['EASYHAPROXY_CERTBOT_SERVER'] = 'schema://url/a'
|
||||
os.environ['EASYHAPROXY_CERTBOT_EAB_KID'] = 'eab_kid'
|
||||
os.environ['EASYHAPROXY_CERTBOT_EAB_HMAC_KEY'] = 'eab_hmac_key'
|
||||
os.environ['EASYHAPROXY_CERTBOT_RETRY_COUNT'] = "10"
|
||||
try:
|
||||
assert {
|
||||
"customerrors": False,
|
||||
|
|
@ -155,6 +163,7 @@ def test_container_env_certbot_full():
|
|||
"server": "schema://url/a",
|
||||
'eab_hmac_key': 'eab_hmac_key',
|
||||
'eab_kid': 'eab_kid',
|
||||
'retry_count': 10
|
||||
}
|
||||
} == ContainerEnv.read()
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue