Merge ~ines-almeida/launchpad:specify-yaml-exception-in-charms into launchpad:master

Proposed by Ines Almeida
Status: Merged
Approved by: Ines Almeida
Approved revision: b4efa064c8d68a8d55ef152f3516e4538b0332ce
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~ines-almeida/launchpad:specify-yaml-exception-in-charms
Merge into: launchpad:master
Diff against target: 44 lines (+4/-4)
2 files modified
charm/launchpad-appserver/reactive/launchpad-appserver.py (+2/-2)
charm/launchpad-librarian/reactive/launchpad-librarian.py (+2/-2)
Reviewer Review Type Date Requested Status
Guruprasad Approve
Colin Watson (community) Approve
Review via email: mp+449697@code.launchpad.net

Commit message

Specify YAML exceptions in haproxy set up in charms

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve
Revision history for this message
Guruprasad (lgp171188) wrote :

LGTM 👍

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charm/launchpad-appserver/reactive/launchpad-appserver.py b/charm/launchpad-appserver/reactive/launchpad-appserver.py
2index 6179dc0..ed2e5d7 100644
3--- a/charm/launchpad-appserver/reactive/launchpad-appserver.py
4+++ b/charm/launchpad-appserver/reactive/launchpad-appserver.py
5@@ -215,7 +215,7 @@ def configure_loadbalancer():
6 service_options_main = yaml.safe_load(
7 config["haproxy_service_options_main"]
8 )
9- except Exception:
10+ except yaml.YAMLError:
11 hookenv.log("Could not parse haproxy_service_options_main YAML")
12 hookenv.status_set(
13 "blocked", "Bad haproxy_service_options_main YAML configuration"
14@@ -225,7 +225,7 @@ def configure_loadbalancer():
15 service_options_xmlrpc = yaml.safe_load(
16 config["haproxy_service_options_xmlrpc"]
17 )
18- except Exception:
19+ except yaml.YAMLError:
20 hookenv.log("Could not parse haproxy_service_options_xmlrpc YAML")
21 hookenv.status_set(
22 "blocked", "Bad haproxy_service_options_xmlrpc YAML configuration"
23diff --git a/charm/launchpad-librarian/reactive/launchpad-librarian.py b/charm/launchpad-librarian/reactive/launchpad-librarian.py
24index 7675da2..c808d9d 100644
25--- a/charm/launchpad-librarian/reactive/launchpad-librarian.py
26+++ b/charm/launchpad-librarian/reactive/launchpad-librarian.py
27@@ -187,7 +187,7 @@ def configure_loadbalancer():
28 service_options_download = yaml.safe_load(
29 config["haproxy_service_options_download"]
30 )
31- except Exception:
32+ except yaml.YAMLError:
33 hookenv.log("Could not parse haproxy_service_options_download YAML")
34 hookenv.status_set(
35 "blocked",
36@@ -198,7 +198,7 @@ def configure_loadbalancer():
37 service_options_upload = yaml.safe_load(
38 config["haproxy_service_options_upload"]
39 )
40- except Exception:
41+ except yaml.YAMLError:
42 hookenv.log("Could not parse haproxy_service_options_upload YAML")
43 hookenv.status_set(
44 "blocked", "Bad haproxy_service_options_upload YAML configuration"

Subscribers

People subscribed via source and target branches

to status/vote changes: