session hook complains about metadata

+ consistent language.
This commit is contained in:
Hossein Shafagh 2020-09-23 14:22:58 -06:00
parent 72be3ba54c
commit e5961146b9
1 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@ def log_status_code(r, *args, **kwargs):
:param kwargs: :param kwargs:
:return: :return:
""" """
metrics.send("entrust_status_code", "counter", 1, metadata={"status_code": r.status_code}) metrics.send(f"entrust_status_code_{r.status_code}", "counter", 1)
def determine_end_date(end_date): def determine_end_date(end_date):
@ -206,12 +206,12 @@ class EntrustIssuerPlugin(IssuerPlugin):
metrics.send("entrust_revoke_certificate", "counter", 1) metrics.send("entrust_revoke_certificate", "counter", 1)
return handle_response(response) return handle_response(response)
def deactivate_certificate(self, certificate, comments): def deactivate_certificate(self, certificate):
"""Deactivates an Entrust certificate.""" """Deactivates an Entrust certificate."""
base_url = current_app.config.get("ENTRUST_URL") base_url = current_app.config.get("ENTRUST_URL")
revoke_url = f"{base_url}/certificates/{certificate.external_id}/deactivations" deactivate_url = f"{base_url}/certificates/{certificate.external_id}/deactivations"
response = self.session.post(revoke_url) response = self.session.post(deactivate_url)
metrics.send("entrust_revoke_certificate", "counter", 1) metrics.send("entrust_deactivate_certificate", "counter", 1)
return handle_response(response) return handle_response(response)
@staticmethod @staticmethod