From d661d623dc3e4bfbc4d1e1059dc1bfa1cd707041 Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Fri, 22 Dec 2023 07:23:24 -0800 Subject: [PATCH] Fixed RUF017 (quadratic-list-summation): Avoid quadratic list summation --- management/ssl_certificates.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/management/ssl_certificates.py b/management/ssl_certificates.py index 3e4bbd2a..3c1df5aa 100755 --- a/management/ssl_certificates.py +++ b/management/ssl_certificates.py @@ -4,6 +4,8 @@ import os, os.path, re, shutil, subprocess, tempfile from utils import shell, safe_domain_name, sort_domains +import functools +import operator # SELECTING SSL CERTIFICATES FOR USE IN WEB @@ -283,7 +285,7 @@ def provision_certificates(env, limit_domains): # Flatten to a list of lists of domains (from a mapping). Remove empty # lists (zones with no domains that need certs). - certs = sum(certs.values(), []) + certs = functools.reduce(operator.iadd, certs.values(), []) certs = [_ for _ in certs if len(_) > 0] # Prepare to provision.