From 2816d3dc8f4c892b0748dfba1a82435ac0c334c0 Mon Sep 17 00:00:00 2001
From: Massimiliano Adamo <maxadamo@gmail.com>
Date: Wed, 22 Jan 2025 12:15:05 +0100
Subject: [PATCH] update image link in README

---
 README.md                 | 2 +-
 wile_coyote/bin/cert2json | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index f46db6d..9f91d86 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # A tool to manage certificates lifecycle on Vault, Redis, Consul
 
-![Wile Coyote](https://filesender.geant.org/images/wile_coyote.jpg "Wile coyote")
+![Wile Coyote](https://cds.geant.org/images/wile_coyote.jpg "Wile coyote")
 
 ## Install the package
 
diff --git a/wile_coyote/bin/cert2json b/wile_coyote/bin/cert2json
index 7a8c614..b3222e5 100755
--- a/wile_coyote/bin/cert2json
+++ b/wile_coyote/bin/cert2json
@@ -38,8 +38,9 @@ else:
 
 
 def inspect_certificate(cert):
-    """ extract data from certificate """
-    pem_data = open(os.path.join(cert, 'fullchain.pem'), "rb").read()
+    """ extract data from the certificate """
+    with open(os.path.join(cert, 'fullchain.pem'), "rb") as pem_file:
+        pem_data = pem_file.read()
     cert = x509.load_pem_x509_certificate(pem_data, default_backend())
     cert_name = cert.subject.get_attributes_for_oid(x509.OID_COMMON_NAME)[0].value.strip()
     serial_raw = f'{cert.serial_number:x}'.upper()
-- 
GitLab