From ea8a7edaacdf77d0f83d10c86c7734548839d170 Mon Sep 17 00:00:00 2001
From: Massimiliano Adamo <maxadamo@gmail.com>
Date: Thu, 10 Sep 2020 18:23:58 +0200
Subject: [PATCH] minor

---
 files/cert2json.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/files/cert2json.py b/files/cert2json.py
index 4ccaed8..2c72c9a 100755
--- a/files/cert2json.py
+++ b/files/cert2json.py
@@ -44,15 +44,13 @@ with open(YAML_FILE, "w") as yaml_out:
     yaml_out.write("{} Certificates:\n".format(PROVIDER_STRING))
     for txt_line in DECODED_OUTPUT:
         if "Certificate Name:" in txt_line:
-            txt_line = re.sub('.*Certificate Name: ', '  ', txt_line)
-            txt_line_out = re.sub('\n', ':\n', txt_line)
+            txt_line_out = re.sub('.*Certificate Name: ', '  ', txt_line) + ":"
         elif "Serial Number: " in txt_line:
             txt_line_out = re.sub('.*Serial Number: ', '    Serial Number: ', txt_line)
         elif "Domains: " in txt_line:
             txt_line_out = re.sub('.*Domains: ', '    Domains: ', txt_line)
         elif "Expiry Date: " in txt_line:
-            txt_line = re.sub('.*Expiry Date: ', '    Expiry Date: "', txt_line)
-            txt_line_out = re.sub('\n', '"\n', txt_line)
+            txt_line_out = re.sub('.*Expiry Date: ', '    Expiry Date: "', txt_line) + '"'
         elif "Certificate Path: " in txt_line:
             txt_line_out = re.sub('.*Certificate Path: ', '    Certificate Path: ', txt_line)
         elif "Private Key Path: " in txt_line:
-- 
GitLab