Merge ~canonical-is-bootstack/charm-grafana:aluria/snap-channel into charm-grafana:master

Proposed by Alvaro Uria
Status: Merged
Approved by: Paul Goins
Approved revision: bf8f93cc8c2c370ab4638517b2dcb2a8660ba15a
Merged at revision: c0014ffd03b48a8cfadadb992c98f7a85ef4c2f8
Proposed branch: ~canonical-is-bootstack/charm-grafana:aluria/snap-channel
Merge into: charm-grafana:master
Diff against target: 46 lines (+11/-3)
3 files modified
reactive/grafana.py (+9/-0)
tests/functional/tests/test_grafana.py (+1/-2)
tox.ini (+1/-1)
Reviewer Review Type Date Requested Status
Paul Goins Approve
Review via email: mp+384447@code.launchpad.net

Commit message

Allow snap channel update

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
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Unable to determine commit message from repository - please click "Set commit message" and enter the commit message manually.

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

Change successfully merged at revision c0014ffd03b48a8cfadadb992c98f7a85ef4c2f8

Revision history for this message
Paul Goins (vultaire) wrote :

Tests have passed. Approved.

review: Approve
Revision history for this message
Paul Goins (vultaire) wrote :

oops, wrong MR, was already merged :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reactive/grafana.py b/reactive/grafana.py
2index c324b41..8fc9576 100644
3--- a/reactive/grafana.py
4+++ b/reactive/grafana.py
5@@ -219,6 +219,15 @@ def config_changed():
6 if config.changed('install_file') and config.get('install_file'):
7 remove_state('grafana.installed')
8
9+ if (config.changed("snap_channel") and
10+ config["snap_channel"] and
11+ not config.changed("install_method") and
12+ config["install_method"] == "snap"):
13+ # NOTE(aluria): install_method change (apt -> snap, and viceversa)
14+ # is not supported. However, snap channel change support was missing
15+ snap.install(SNAP_NAME, channel=config["snap_channel"], force_dangerous=False)
16+ hookenv.log("{} snap channel updated to {}".format(SNAP_NAME, config["snap_channel"]))
17+
18
19 def check_ports(new_port):
20 kv = unitdata.kv()
21diff --git a/tests/functional/tests/test_grafana.py b/tests/functional/tests/test_grafana.py
22index 784ad61..f01a6ee 100644
23--- a/tests/functional/tests/test_grafana.py
24+++ b/tests/functional/tests/test_grafana.py
25@@ -8,8 +8,7 @@ import unittest
26 import zaza.model as model
27
28
29-TEST_TIMEOUT = 180
30-DASH_TIMEOUT = 600
31+TEST_TIMEOUT = 600
32 DEFAULT_API_PORT = "3000"
33 DEFAULT_API_URL = "/"
34
35diff --git a/tox.ini b/tox.ini
36index c595483..b5bb135 100644
37--- a/tox.ini
38+++ b/tox.ini
39@@ -65,6 +65,6 @@ exclude =
40 # I201: Missing newline between import groups
41 # I100: Import statements are in the wrong order
42
43-ignore = H405,D100,D101,D102,D103,D104,D105,D107,D200,D202,D203,D204,D205,D208,D400,D401,I100,I201,W503
44+ignore = H405,D100,D101,D102,D103,D104,D105,D107,D200,D202,D203,D204,D205,D208,D400,D401,I100,I201,W503,W504
45 max-line-length = 120
46 max-complexity = 10

Subscribers

People subscribed via source and target branches

to all changes: