From 718ad6504e6c0c4460bf9642e66acc2cc82eba5a Mon Sep 17 00:00:00 2001 From: Basit Mustafa Date: Sat, 16 Sep 2023 05:13:18 -0600 Subject: [PATCH] fix various exception/failure path undefineds (#14) (thanks @24601) * fix(helpers): fix undefined var in exception handler * fix(helper): exception handler issue * fix(slack): SLACK_WEBHOOK_URL was undefined in failure path --------- Co-authored-by: Farley Farley (yes, really) --- helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers.py b/helpers.py index 0d6b37f..3a1115d 100644 --- a/helpers.py +++ b/helpers.py @@ -331,7 +331,7 @@ def convert_pvc_to_simpler_dict(pvc): try: if 'volume.autoscaler.kubernetes.io/scale-up-percent' in pvc.metadata.annotations: return_dict['scale_up_percent'] = int(pvc.metadata.annotations['volume.autoscaler.kubernetes.io/scale-up-percent']) - except: + except Exception as e: print("Could not convert scale_up_percent to int: {}".format(e)) try: @@ -349,7 +349,7 @@ def convert_pvc_to_simpler_dict(pvc): try: if 'volume.autoscaler.kubernetes.io/scale-up-max-size' in pvc.metadata.annotations: return_dict['scale_up_max_size'] = int(pvc.metadata.annotations['volume.autoscaler.kubernetes.io/scale-up-max-size']) - except: + except Exception as e: print("Could not convert scale_up_max_size to int: {}".format(e)) try: