forked from ungleich-public/cdist
[type/__postgres_conf] Reverse state logic (decide based on source first)
This commit is contained in:
parent
bef1433ba3
commit
686e4f0f2d
1 changed files with 20 additions and 19 deletions
|
@ -200,23 +200,24 @@ psql_exec 'SELECT 1' >/dev/null || {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if psql_conf_cmp "${conf_name}" "$(cat "${__object:?}/parameter/value")"
|
case $(psql_conf_source "${conf_name}")
|
||||||
then
|
in
|
||||||
echo present
|
|
||||||
else
|
|
||||||
case $(psql_conf_source "${conf_name}")
|
|
||||||
in
|
|
||||||
('')
|
('')
|
||||||
# invalid configuration parameter
|
printf 'Invalid configuration parameter: %s\n' "${conf_name}" >&2
|
||||||
# (error message was already printed by SHOW command above.
|
|
||||||
# Yes, it's a hack)
|
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
(default)
|
(default)
|
||||||
echo absent
|
echo absent
|
||||||
;;
|
;;
|
||||||
(*)
|
(*)
|
||||||
|
if ! test -f "${__object:?}/parameter/value"
|
||||||
|
then
|
||||||
|
echo present
|
||||||
|
elif psql_conf_cmp "${conf_name}" "$(cat "${__object:?}/parameter/value")"
|
||||||
|
then
|
||||||
|
echo present
|
||||||
|
else
|
||||||
echo different
|
echo different
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
|
|
Loading…
Reference in a new issue