From 7c5f8cdf6c66c0647faf8424bebe7a71eab43286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Li=C3=A9tar?= Date: Mon, 9 Dec 2024 18:11:28 +0000 Subject: [PATCH] fixup --- src/montagu_deploy/cli.py | 4 +--- src/montagu_deploy/config.py | 4 +++- tests/test_integration.py | 8 ++++---- tests/utils.py | 4 +--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/montagu_deploy/cli.py b/src/montagu_deploy/cli.py index 63a09a2..98cbd62 100644 --- a/src/montagu_deploy/cli.py +++ b/src/montagu_deploy/cli.py @@ -50,9 +50,7 @@ def main(argv=None): elif args.action == "stop": montagu_stop(obj, args, cfg) elif args.action == "renew-certificate": - montagu_renew_certificate(obj, cfg, - force_renewal=args.force_renewal, - expand=args.expand) + montagu_renew_certificate(obj, cfg, force_renewal=args.force_renewal, expand=args.expand) return True diff --git a/src/montagu_deploy/config.py b/src/montagu_deploy/config.py index b2e5614..307cf6d 100644 --- a/src/montagu_deploy/config.py +++ b/src/montagu_deploy/config.py @@ -67,7 +67,9 @@ def __init__(self, path, extra=None, options=None): self.acme_email = config.config_string(dat, ["proxy", "acme", "email"]) self.acme_server = config.config_string(dat, ["proxy", "acme", "server"], is_optional=True) self.acme_no_verify_ssl = config.config_boolean(dat, ["proxy", "acme", "no_verify_ssl"], is_optional=True) - self.acme_additional_domains = config.config_list(dat, ["proxy", "acme", "additional_domains"], is_optional=True, default=[]) + self.acme_additional_domains = config.config_list( + dat, ["proxy", "acme", "additional_domains"], is_optional=True, default=[] + ) else: self.ssl_mode = "self-signed" diff --git a/tests/test_integration.py b/tests/test_integration.py index 53fe1c1..1625ab7 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -120,7 +120,7 @@ def test_acme_certificate(): try: options = [ - f"--option=proxy.acme.server=https://pebble/dir", + "--option=proxy.acme.server=https://pebble/dir", "--option=proxy.acme.no_verify_ssl=true", ] @@ -134,7 +134,7 @@ def test_acme_certificate(): # We set this up by adding a custom /etc/hosts in the pebble container pointing to the # right IP address. container = docker.from_env().containers.get("montagu-proxy") - ip = container.attrs['NetworkSettings']['Networks'][network]['IPAddress'] + ip = container.attrs["NetworkSettings"]["Networks"][network]["IPAddress"] hostnames = { "montagu.org": ip, "montagu-dev.org": ip, @@ -167,8 +167,8 @@ def test_acme_certificate(): assert "CN=Pebble Intermediate CA" in cert.issuer.rfc4514_string() san = cert.extensions.get_extension_for_oid(ExtensionOID.SUBJECT_ALTERNATIVE_NAME) assert set(san.value.get_values_for_type(x509.DNSName)) == { - 'montagu.org', - 'montagu-dev.org', + "montagu.org", + "montagu-dev.org", } # When restarting the server, the certificate we got from ACME is diff --git a/tests/utils.py b/tests/utils.py index 0726133..e539572 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -56,9 +56,7 @@ def run_pebble(**kwargs): } with create_container( - "ghcr.io/letsencrypt/pebble:latest", command=["-config", "/config.json"], - environment=env, - **kwargs + "ghcr.io/letsencrypt/pebble:latest", command=["-config", "/config.json"], environment=env, **kwargs ) as container: docker_util.string_into_container(json.dumps(config), container, "/config.json") container.start()