Merge ~hloeung/influxdb-charm:master into influxdb-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Paul Gear
Approved revision: 6efbf50ef19cbb0e24f525f49fb8d29b444e3b0a
Merged at revision: 61b0843ca2a40871f6c2e37db7b7e068b5c9ebae
Proposed branch: ~hloeung/influxdb-charm:master
Merge into: influxdb-charm:master
Diff against target: 55 lines (+9/-12)
1 file modified
reactive/influxdb.py (+9/-12)
Reviewer Review Type Date Requested Status
Paul Gear (community) Approve
Review via email: mp+346781@code.launchpad.net

Commit message

Revert 3a3394e0c33003e208a4096f13c61bcc49b356ec

Description of the change

Thought splitting into a different state would trigger a different reactive run but that is not the case.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Paul Gear (paulgear) wrote :

LGTM

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 61b0843ca2a40871f6c2e37db7b7e068b5c9ebae

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reactive/influxdb.py b/reactive/influxdb.py
2index 985576c..0502220 100644
3--- a/reactive/influxdb.py
4+++ b/reactive/influxdb.py
5@@ -38,7 +38,7 @@ def configure_website(website):
6 website.configure(port=port)
7
8
9-@when_not('influxdb.installed')
10+@when_not('influxdb.configured')
11 @when('apt.installed.influxdb')
12 def install_influx():
13 config = hookenv.config()
14@@ -47,6 +47,9 @@ def install_influx():
15 hookenv.open_port(port)
16 config_changed()
17 host.service_start('influxdb')
18+ hookenv.status_set('active', '')
19+ set_state('influxdb.configured')
20+ set_state('config.changed')
21 # This is a hack because the CLI shell tool is packaged differently in
22 # upstream and Debian/Ubuntu. Upstream has no 'influxdb-client' package.
23 try:
24@@ -57,18 +60,12 @@ def install_influx():
25 # python3-influxdb only exists in Ubuntu Xenial and beyond - LP: #1732015.
26 if series not in ('precise', 'trusty'):
27 apt_install('python3-influxdb')
28- remove_state('influxdb.configured')
29- set_state('influxdb.installed')
30-
31-
32-@when_not('influxdb.configured')
33-@when('influxdb.installed')
34-def configure_influxdb():
35+ # Yes, this is gross, but we're going to need it shortly.
36+ global have_influxdbclient, influxdb
37+ import influxdb
38+ have_influxdbclient = True
39 if have_influxdbclient:
40 configure_influxdb_auth()
41- hookenv.status_set('active', '')
42- set_state('influxdb.configured')
43- set_state('config.changed')
44
45
46 def configure_influxdb_auth():
47@@ -217,7 +214,7 @@ def upgrade_charm():
48 else:
49 raise
50
51- remove_state('influxdb.installed')
52+ remove_state('influxdb.configured')
53 set_state('config.changed.backup_dir')
54 # If we have an NRPE relation, force run of that as well
55 if hookenv.relation_ids('nrpe-exteral-master'):

Subscribers

People subscribed via source and target branches

to all changes: