Commit b4f9ed3a authored by Alain Takoudjou's avatar Alain Takoudjou

[monitor] promise-check-slapgrid: prevent display sensitive information in promise output

This promise fail if slapgrid failed to process the partition and verbose the failed buildout log. It's possible that buildout logs contain information that should not be public, so put the log in a private folder and add the link to it to the promise result.
parent 512253cd
...@@ -15,4 +15,4 @@ ...@@ -15,4 +15,4 @@
# not need these here). # not need these here).
[monitor2-template] [monitor2-template]
filename = instance-monitor.cfg.jinja2.in filename = instance-monitor.cfg.jinja2.in
md5sum = 5027f0b1abcc28ce3817cd70fb667a3b md5sum = 8ec30221c7560cab83ab879f9e9ff1f5
...@@ -369,8 +369,12 @@ mode = 700 ...@@ -369,8 +369,12 @@ mode = 700
recipe = collective.recipe.template recipe = collective.recipe.template
error-log-file = ${buildout:directory}/.slapgrid-${slap-connection:partition-id}-error.log error-log-file = ${buildout:directory}/.slapgrid-${slap-connection:partition-id}-error.log
input = inline:#!/bin/sh input = inline:#!/bin/sh
BUILDOUT_LOG="${directory:log}/slapgrid-${slap-connection:partition-id}-error.log"
rm -f $BUILDOUT_LOG
if [ -f "${:error-log-file}" ]; then if [ -f "${:error-log-file}" ]; then
>&2 cat ${:error-log-file} ln -sf ${:error-log-file} $BUILDOUT_LOG
>&2 echo "Buildout failed to process partition ${slap-connection:partition-id}"
>&2 echo "More info can be found here: ${monitor-base:base-url}/log/slapgrid-${slap-connection:partition-id}-error.log"
exit 1 exit 1
fi fi
output = ${monitor-directory:promises}/buildout-${slap-connection:partition-id}-status output = ${monitor-directory:promises}/buildout-${slap-connection:partition-id}-status
......
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