Merge ~vultaire/charm-graylog:lp1879363 into charm-graylog:master

Proposed by Paul Goins
Status: Merged
Approved by: Jeremy Lounder
Approved revision: bb1d1c32c0aeb448e9a9041ff7cc6ac39fef6ba0
Merged at revision: bb1d1c32c0aeb448e9a9041ff7cc6ac39fef6ba0
Proposed branch: ~vultaire/charm-graylog:lp1879363
Merge into: charm-graylog:master
Diff against target: 29 lines (+12/-6)
1 file modified
reactive/graylog.py (+12/-6)
Reviewer Review Type Date Requested Status
Jeremy Lounder (community) Approve
Xav Paice (community) Approve
Review via email: mp+384135@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Xav Paice (xavpaice) wrote :

LGTM

review: Approve
Revision history for this message
Jeremy Lounder (jldev) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reactive/graylog.py b/reactive/graylog.py
2index 4c3c81f..3db920c 100644
3--- a/reactive/graylog.py
4+++ b/reactive/graylog.py
5@@ -326,12 +326,18 @@ def report_status():
6 @when_not('graylog_api.configured')
7 def configure_graylog_api(*discard):
8 """Adjust states to ensure API dependents will be correctly configured."""
9- _verify_rest_api_is_alive()
10- remove_state('beat.setup')
11- remove_state('graylog_index_sets.configured')
12- remove_state('graylog_inputs.configured')
13- remove_state('graylog_nagios.configured')
14- set_state('graylog_api.configured')
15+ try:
16+ _verify_rest_api_is_alive()
17+ except ApiTimeout:
18+ # Corner case: ES/Mongo are up, but REST API is not up yet.
19+ # Just wait (status already set in report_status()) and try again next time.
20+ pass
21+ else:
22+ remove_state('beat.setup')
23+ remove_state('graylog_index_sets.configured')
24+ remove_state('graylog_inputs.configured')
25+ remove_state('graylog_nagios.configured')
26+ set_state('graylog_api.configured')
27
28
29 @when('graylog.configured') # noqa: C901

Subscribers

People subscribed via source and target branches

to all changes: