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
diff --git a/reactive/influxdb.py b/reactive/influxdb.py
index 985576c..0502220 100644
--- a/reactive/influxdb.py
+++ b/reactive/influxdb.py
@@ -38,7 +38,7 @@ def configure_website(website):
38 website.configure(port=port)38 website.configure(port=port)
3939
4040
41@when_not('influxdb.installed')41@when_not('influxdb.configured')
42@when('apt.installed.influxdb')42@when('apt.installed.influxdb')
43def install_influx():43def install_influx():
44 config = hookenv.config()44 config = hookenv.config()
@@ -47,6 +47,9 @@ def install_influx():
47 hookenv.open_port(port)47 hookenv.open_port(port)
48 config_changed()48 config_changed()
49 host.service_start('influxdb')49 host.service_start('influxdb')
50 hookenv.status_set('active', '')
51 set_state('influxdb.configured')
52 set_state('config.changed')
50 # This is a hack because the CLI shell tool is packaged differently in53 # This is a hack because the CLI shell tool is packaged differently in
51 # upstream and Debian/Ubuntu. Upstream has no 'influxdb-client' package.54 # upstream and Debian/Ubuntu. Upstream has no 'influxdb-client' package.
52 try:55 try:
@@ -57,18 +60,12 @@ def install_influx():
57 # python3-influxdb only exists in Ubuntu Xenial and beyond - LP: #1732015.60 # python3-influxdb only exists in Ubuntu Xenial and beyond - LP: #1732015.
58 if series not in ('precise', 'trusty'):61 if series not in ('precise', 'trusty'):
59 apt_install('python3-influxdb')62 apt_install('python3-influxdb')
60 remove_state('influxdb.configured')63 # Yes, this is gross, but we're going to need it shortly.
61 set_state('influxdb.installed')64 global have_influxdbclient, influxdb
6265 import influxdb
6366 have_influxdbclient = True
64@when_not('influxdb.configured')
65@when('influxdb.installed')
66def configure_influxdb():
67 if have_influxdbclient:67 if have_influxdbclient:
68 configure_influxdb_auth()68 configure_influxdb_auth()
69 hookenv.status_set('active', '')
70 set_state('influxdb.configured')
71 set_state('config.changed')
7269
7370
74def configure_influxdb_auth():71def configure_influxdb_auth():
@@ -217,7 +214,7 @@ def upgrade_charm():
217 else:214 else:
218 raise215 raise
219216
220 remove_state('influxdb.installed')217 remove_state('influxdb.configured')
221 set_state('config.changed.backup_dir')218 set_state('config.changed.backup_dir')
222 # If we have an NRPE relation, force run of that as well219 # If we have an NRPE relation, force run of that as well
223 if hookenv.relation_ids('nrpe-exteral-master'):220 if hookenv.relation_ids('nrpe-exteral-master'):

Subscribers

People subscribed via source and target branches

to all changes: