Merge ~pjdc/influxdb-charm/+git/influxdb-charm:back-up-with-ancient-clients into influxdb-charm:master

Proposed by Paul Collins
Status: Merged
Approved by: Haw Loeung
Approved revision: e37e4cefcc2377268faa08f3859b896d208e371f
Merged at revision: 054f30aad7e3cc79cc6809b8e0241c07018dca31
Proposed branch: ~pjdc/influxdb-charm/+git/influxdb-charm:back-up-with-ancient-clients
Merge into: influxdb-charm:master
Diff against target: 26 lines (+14/-1)
1 file modified
templates/influxdb-backup (+14/-1)
Reviewer Review Type Date Requested Status
Haw Loeung Approve
Review via email: mp+335348@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/templates/influxdb-backup b/templates/influxdb-backup
2index cb53a44..cd3fabf 100644
3--- a/templates/influxdb-backup
4+++ b/templates/influxdb-backup
5@@ -17,7 +17,20 @@ if [ -r /root/.influx-auth ]; then
6 export INFLUX_USERNAME INFLUX_PASSWORD
7 fi
8
9-DATABASES=$(influx --execute 'show databases' --format=json | jq --raw-output '.results[0].series[0].values[][0]' | grep -ve '^_internal$')
10+# Leak credentials only when necessary. Support
11+# for the environment variables was added in
12+# version 1.1.0. Note that earlier versions of the
13+# shell display their version differently.
14+auth_args=""
15+case $(influx -version) in
16+ "InfluxDB shell version: 1.0."*|"InfluxDB shell 0."*)
17+ auth_args="-username ${INFLUX_USERNAME} -password ${INFLUX_PASSWORD}"
18+ ;;
19+ *)
20+ ;;
21+esac
22+
23+DATABASES=$(influx ${auth_args} --execute 'show databases' --format=json | jq --raw-output '.results[0].series[0].values[][0]' | grep -ve '^_internal$')
24
25 # back up metadata
26 influxd backup $TODAY_DIR/metdata

Subscribers

People subscribed via source and target branches

to all changes: