Commit d783653f authored by Jérome Perrin's avatar Jérome Perrin

software/grafana: promise to check influxdb is usable

This should fix this random failure with tests:

    ======================================================================
    FAIL: test_influxdb_api (test.TestInfluxDb)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "parts/slapos-repository/software/grafana/test/test.py", line 126, in test_influxdb_api
        [connection_params['influxdb-database']], result['series'][0]['values'])
    AssertionError: ['telegraf'] not found in [[u'_internal']]
parent d07869d0
Pipeline #8898 failed with stage
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
[instance-profile] [instance-profile]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 214a756a6a9f73455411760b2daa25b7 md5sum = 0edf9e67bc637d73a7415124c8082a8c
[influxdb-config-file] [influxdb-config-file]
filename = influxdb-config-file.cfg.in filename = influxdb-config-file.cfg.in
......
...@@ -126,6 +126,18 @@ command-line = ...@@ -126,6 +126,18 @@ command-line =
{{ influx_bin }} -username ${influxdb:auth-username} -password ${influxdb:auth-password} -socket ${influxdb:unix-socket} -execute "CREATE USER ${influxdb:auth-username} WITH PASSWORD '${influxdb:auth-password}' WITH ALL PRIVILEGES" {{ influx_bin }} -username ${influxdb:auth-username} -password ${influxdb:auth-password} -socket ${influxdb:unix-socket} -execute "CREATE USER ${influxdb:auth-username} WITH PASSWORD '${influxdb:auth-password}' WITH ALL PRIVILEGES"
wrapper-path = ${directory:promise}/${:_buildout_section_name_} wrapper-path = ${directory:promise}/${:_buildout_section_name_}
[influxdb-database-ready-promise]
recipe = slapos.cookbook:wrapper
command-line =
bash -c "{{ influx_bin }} \
-username ${influxdb:auth-username} \
-password ${influxdb:auth-password} \
-host ${influxdb:host} \
-port ${influxdb:http-port} \
-unsafeSsl \
-ssl \
-execute 'show databases' | grep '${influxdb:database}'"
wrapper-path = ${directory:promise}/${:_buildout_section_name_}
[grafana] [grafana]
...@@ -261,6 +273,7 @@ recipe = ...@@ -261,6 +273,7 @@ recipe =
instance-promises = instance-promises =
${influxdb-listen-promise:path} ${influxdb-listen-promise:path}
${influxdb-password-promise:wrapper-path} ${influxdb-password-promise:wrapper-path}
${influxdb-database-ready-promise:wrapper-path}
${grafana-listen-promise:path} ${grafana-listen-promise:path}
${loki-listen-promise:path} ${loki-listen-promise:path}
${promtail-listen-promise:path} ${promtail-listen-promise:path}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment