From f0f13ce97b2ee9536ca20e3c08bb923276003c6e Mon Sep 17 00:00:00 2001 From: sirferl Date: Thu, 3 Dec 2020 08:30:54 +0100 Subject: [PATCH] Removed commented log lines Added logging of number of downloaded certificates --- lemur/plugins/lemur_entrust/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lemur/plugins/lemur_entrust/plugin.py b/lemur/plugins/lemur_entrust/plugin.py index c2d9caef..8c50fd6e 100644 --- a/lemur/plugins/lemur_entrust/plugin.py +++ b/lemur/plugins/lemur_entrust/plugin.py @@ -355,6 +355,7 @@ class EntrustSourcePlugin(SourcePlugin): get_url = f"{base_url}/certificates" certs = [] + processed_certs = 0 offset = 0 while True: response = self.session.get(get_url, @@ -373,14 +374,12 @@ class EntrustSourcePlugin(SourcePlugin): status_code = response.status_code if status_code > 399: raise Exception(f"ENTRUST error: {status_code}\n{data['errors']}") - # current_app.logger.info(f"recevied: {data['summary']}") for c in data["certificates"]: download_url = "{0}{1}".format( host, c["uri"] ) cert_response = self.session.get(download_url) certificate = json.loads(cert_response.content) - # current_app.logger.info(f"Result: {certificate}") # normalize serial serial = str(int(certificate["serialNumber"], 16)) cert = { @@ -389,11 +388,12 @@ class EntrustSourcePlugin(SourcePlugin): "external_id": str(certificate["trackingId"]), } certs.append(cert) + processed_certs += 1 if data["summary"]["limit"] * offset >= data["summary"]["total"]: break else: offset += 1 - current_app.logger.info(f"Result: {certs}") + current_app.logger.info(f"Retrieved {processed_certs} ertificates") return certs def get_endpoints(self, options, **kwargs):