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
diff --git a/src/reactive/grafana.py b/src/reactive/grafana.py
index a9468c1..0addf37 100644
--- a/src/reactive/grafana.py
+++ b/src/reactive/grafana.py
@@ -501,7 +501,7 @@ def setup_grafana():
501501
502 _maybe_install_ca_certificates_hook()502 _maybe_install_ca_certificates_hook()
503503
504 # write the certificates given via juju config504 # Write the certificates provided via juju config
505 if config_defined_ssl_cert() and config_defined_ssl_key():505 if config_defined_ssl_cert() and config_defined_ssl_key():
506 os.makedirs(CERT_DIR[config["install_method"]], exist_ok=True)506 os.makedirs(CERT_DIR[config["install_method"]], exist_ok=True)
507 with open(CERT_PATH[config["install_method"]], "wb") as f:507 with open(CERT_PATH[config["install_method"]], "wb") as f:
@@ -981,9 +981,7 @@ def generate_prometheus_dashboards(gf_adminpasswd, ds):
981 )981 )
982 return982 return
983 else:983 else:
984 hookenv.status_set(984 hookenv.status_set("active", "Ready")
985 "active", "Ready"
986 )
987985
988 current_dashboards = get_current_dashboards(config["port"], gf_adminpasswd)986 current_dashboards = get_current_dashboards(config["port"], gf_adminpasswd)
989 dash_to_uid = {987 dash_to_uid = {
@@ -1385,21 +1383,19 @@ def tls_certificate_changed():
13851383
13861384
1387def _ensure_certs_permissions():1385def _ensure_certs_permissions():
1386 inst_method = hookenv.config("install_method")
1388 # The certificates when written by the tls-client layer are set with the1387 # The certificates when written by the tls-client layer are set with the
1389 # permissions 0o770 and this section will be effectively a NOOP, but when1388 # permissions 0o770 and this section will be effectively a NOOP, but when
1390 # they are written by the charm because the operator used the "juju1389 # they are written by the charm because the operator used the "juju
1391 # config" configuration options this will set the permissions according to1390 # config" configuration options this will set the permissions according to
1392 # the expectatives of the code.1391 # the expectatives of the code.
1393 os.chmod(CERT_PATH[hookenv.config("install_method")], stat.S_IRWXU | stat.S_IRWXG)1392 os.chmod(CERT_PATH[inst_method], stat.S_IRWXU | stat.S_IRWXG)
1394 os.chmod(1393 os.chmod(CERT_KEY_PATH[inst_method], stat.S_IRWXU | stat.S_IRWXG)
1395 CERT_KEY_PATH[hookenv.config("install_method")], stat.S_IRWXU | stat.S_IRWXG
1396 )
13971394
1398 # The certificates written are owned by root and 0o770 permissions which1395 # The certificates written are owned by root with 0o770 permissions which
1399 # prevents the grafana-server process to read them when using the Debian1396 # prevents the grafana-server process to read them when using the Debian
1400 # package, so the parent directory needs to allow the access for the1397 # package, so the parent directory needs to allow the access for the
1401 # 'grafana' group.1398 # 'grafana' group.
1402 inst_method = hookenv.config("install_method")
1403 if inst_method == "apt":1399 if inst_method == "apt":
1404 uid = pwd.getpwnam("root").pw_uid1400 uid = pwd.getpwnam("root").pw_uid
1405 gid = grp.getgrnam("grafana").gr_gid1401 gid = grp.getgrnam("grafana").gr_gid

Subscribers

People subscribed via source and target branches

to all changes: