From 989d82c7bcca26875c6a6a074ebf586036365234 Mon Sep 17 00:00:00 2001 From: "Christian R. Garcia" Date: Mon, 28 Oct 2024 22:57:31 -0700 Subject: [PATCH] health --- service/health.py | 5 +++-- service/models_pods.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/service/health.py b/service/health.py index d4840ef..13e1505 100644 --- a/service/health.py +++ b/service/health.py @@ -101,7 +101,7 @@ def graceful_rm_pod(pod, log=None): return rm_pod(pod.k8_name) except Exception as e: - logger.error(f"Failed to gracefully remove pod {pod.k8_name}: {e}") + logger.error(f"Failed to gracefully remove pod {pod.k8_name}") raise def graceful_rm_volume(volume): @@ -119,8 +119,9 @@ def graceful_rm_volume(volume): return rm_volume(volume.k8_name) except Exception as e: - logger.error(f"Failed to gracefully remove volume {volume.k8_name}: {e}") + logger.error(f"Failed to gracefully remove volume {volume.k8_name}") raise + def check_k8_pods(k8_pods): """ Check the health of Kubernetes pods. diff --git a/service/models_pods.py b/service/models_pods.py index ed91635..5ee8967 100644 --- a/service/models_pods.py +++ b/service/models_pods.py @@ -420,7 +420,8 @@ def check_template(cls, values): template = values.get('template') tenant_id = values.get('tenant_id') site_id = values.get('site_id') - + logger.debug(f"top of PodBaseFull.check_template() with template: {template}, tenant_id: {tenant_id}, site_id: {site_id}") + if template is not None and tenant_id is not None and site_id is not None: logger.debug(f"top of PodBaseFull.check_template() with template: {template}, tenant_id: {tenant_id}, site_id: {site_id}") template_name_str, template, template_tag = derive_template_info(template, tenant_id, site_id)