Buuuurn glances

This commit is contained in:
Alexandre Aubin 2020-05-28 15:03:23 +02:00
parent 8ecd8fe6a3
commit 17eec25ed2
2 changed files with 5 additions and 36 deletions

View file

@ -1,36 +0,0 @@
#!/bin/bash
set -e
do_pre_regen() {
pending_dir=$1
cd /usr/share/yunohost/templates/glances
install -D -m 644 glances.default "${pending_dir}/etc/default/glances"
}
do_post_regen() {
regen_conf_files=$1
[[ -z "$regen_conf_files" ]] \
|| service glances restart
}
FORCE=${2:-0}
DRY_RUN=${3:-0}
case "$1" in
pre)
do_pre_regen $4
;;
post)
do_post_regen $4
;;
*)
echo "hook called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0

View file

@ -346,6 +346,11 @@ def _save_regenconf_infos(infos):
Keyword argument:
categories -- A dict containing the regenconf infos
"""
# Ugly hack to get rid of legacy glances stuff
if "glances" in infos:
del infos["glances"]
try:
with open(REGEN_CONF_FILE, 'w') as f:
yaml.safe_dump(infos, f, default_flow_style=False)