Skip to content

Commit

Permalink
fix various exception/failure path undefineds (#14) (thanks @24601)
Browse files Browse the repository at this point in the history
* 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) <farley@neonsurge.com>
  • Loading branch information
24601 and AndrewFarley authored Sep 16, 2023
1 parent 19e3918 commit 718ad65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 718ad65

Please sign in to comment.