Merge ~ines-almeida/ols-charm-deps:specify-yaml-error-http-layer into ols-charm-deps:master

Proposed by Ines Almeida
Status: Merged
Approved by: Ines Almeida
Approved revision: 541234bc6ce31468238351f77d88ea7d4e733d6a
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~ines-almeida/ols-charm-deps:specify-yaml-error-http-layer
Merge into: ols-charm-deps:master
Diff against target: 22 lines (+2/-2)
1 file modified
layer/ols-http/reactive/ols_http.py (+2/-2)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+449702@code.launchpad.net

Commit message

Specify YAML exceptions in ols-http layer

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/layer/ols-http/reactive/ols_http.py b/layer/ols-http/reactive/ols_http.py
2index 279615c..ba58d53 100644
3--- a/layer/ols-http/reactive/ols_http.py
4+++ b/layer/ols-http/reactive/ols_http.py
5@@ -56,7 +56,7 @@ def configure_loadbalancer(lb):
6
7 try:
8 yaml.safe_load(services_yaml)
9- except Exception:
10+ except yaml.YAMLError:
11 hookenv.log('Could not parse templated haproxy yaml')
12 hookenv.status_set('blocked', 'bad haproxy_services yaml template config')
13 return
14@@ -64,7 +64,7 @@ def configure_loadbalancer(lb):
15 else:
16 try:
17 options = yaml.safe_load(config.get('haproxy_service_options'))
18- except Exception:
19+ except yaml.YAMLError:
20 hookenv.log('could not parse haproxy_service_options yaml')
21 hookenv.status_set('blocked', 'bad haproxy_service_options yaml config')
22 return

Subscribers

People subscribed via source and target branches