From bb418c23fc9e490fc7ca9ddfd0e477bd07769a8d Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Fri, 30 Aug 2019 07:50:35 +0200 Subject: [PATCH] Fix csv reading --- wo/cli/plugins/site_functions.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 1aac6c5..389616d 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -1482,18 +1482,17 @@ def checkWildcardExist(self, wo_domain_name): with open('/var/lib/wo/cert.csv', 'rt') as wo_cert: reader = csv.reader(wo_cert, 'acmeconf') wo_wildcard = "*.{0}".format(wo_domain_name) - try: - for row in reader: - if wo_wildcard in row[2]: - break - return True - else: - return False - except csv.Error as e: - Log.debug(self, "{0}".format(e)) - Log.error(self, "Failed to read cert list") - finally: - wo_cert.close() + try: + for row in reader: + if wo_wildcard in row[2]: + break + return True + else: + return False + except csv.Error as e: + Log.debug(self, "{0}".format(e)) + Log.error(self, "Failed to read cert list") + # copy wildcard certificate to a subdomain