Merge ~freyes/charm-grafana:minor-changes into charm-grafana:master

Proposed by Felipe Reyes
Status: Merged
Approved by: James Troup
Approved revision: e87f0805b3bcf8a64fa6416bbc42b99d5d967c30
Merged at revision: c9476829275128dbd65832dbddd0452269b3482f
Proposed branch: ~freyes/charm-grafana:minor-changes
Merge into: charm-grafana:master
Diff against target: 50 lines (+6/-10)
1 file modified
src/reactive/grafana.py (+6/-10)
Reviewer Review Type Date Requested Status
BootStack Reviewers Pending
BootStack Reviewers Pending
Review via email: mp+408635@code.launchpad.net

Commit message

Description of the change

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

Change has no commit message, setting status to needs review.

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

Change successfully merged at revision c9476829275128dbd65832dbddd0452269b3482f

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/reactive/grafana.py b/src/reactive/grafana.py
2index a9468c1..0addf37 100644
3--- a/src/reactive/grafana.py
4+++ b/src/reactive/grafana.py
5@@ -501,7 +501,7 @@ def setup_grafana():
6
7 _maybe_install_ca_certificates_hook()
8
9- # write the certificates given via juju config
10+ # Write the certificates provided via juju config
11 if config_defined_ssl_cert() and config_defined_ssl_key():
12 os.makedirs(CERT_DIR[config["install_method"]], exist_ok=True)
13 with open(CERT_PATH[config["install_method"]], "wb") as f:
14@@ -981,9 +981,7 @@ def generate_prometheus_dashboards(gf_adminpasswd, ds):
15 )
16 return
17 else:
18- hookenv.status_set(
19- "active", "Ready"
20- )
21+ hookenv.status_set("active", "Ready")
22
23 current_dashboards = get_current_dashboards(config["port"], gf_adminpasswd)
24 dash_to_uid = {
25@@ -1385,21 +1383,19 @@ def tls_certificate_changed():
26
27
28 def _ensure_certs_permissions():
29+ inst_method = hookenv.config("install_method")
30 # The certificates when written by the tls-client layer are set with the
31 # permissions 0o770 and this section will be effectively a NOOP, but when
32 # they are written by the charm because the operator used the "juju
33 # config" configuration options this will set the permissions according to
34 # the expectatives of the code.
35- os.chmod(CERT_PATH[hookenv.config("install_method")], stat.S_IRWXU | stat.S_IRWXG)
36- os.chmod(
37- CERT_KEY_PATH[hookenv.config("install_method")], stat.S_IRWXU | stat.S_IRWXG
38- )
39+ os.chmod(CERT_PATH[inst_method], stat.S_IRWXU | stat.S_IRWXG)
40+ os.chmod(CERT_KEY_PATH[inst_method], stat.S_IRWXU | stat.S_IRWXG)
41
42- # The certificates written are owned by root and 0o770 permissions which
43+ # The certificates written are owned by root with 0o770 permissions which
44 # prevents the grafana-server process to read them when using the Debian
45 # package, so the parent directory needs to allow the access for the
46 # 'grafana' group.
47- inst_method = hookenv.config("install_method")
48 if inst_method == "apt":
49 uid = pwd.getpwnam("root").pw_uid
50 gid = grp.getgrnam("grafana").gr_gid

Subscribers

People subscribed via source and target branches

to all changes: