@ -2148,7 +2148,7 @@ service:relation-file() {
fi
fi
relation="${service_path##*${TRAVERSE_SEPARATOR}}"
relation="${service_path##*${TRAVERSE_SEPARATOR}}"
service=$(service:traverse "${service_path%${TRAVERSE_SEPARATOR}*}") || return 1
service=$(service:traverse "${service_path%${TRAVERSE_SEPARATOR}*}") || return 1
if ! read-0 ts _ _ < <(get_service_relation "${service}" "${relation}"); then
if ! read-0 ts rc _ < <(get_service_relation "${service}" "${relation}"); then
err "Couldn't find relation ${DARKCYAN}${relation}${NORMAL}" \
err "Couldn't find relation ${DARKCYAN}${relation}${NORMAL}" \
"from ${DARKYELLOW}$service${NORMAL}."
"from ${DARKYELLOW}$service${NORMAL}."
return 1
return 1
@ -2157,7 +2157,12 @@ service:relation-file() {
err "Failed to find relation file"
err "Failed to find relation file"
return 1
return 1
}
}
echo "$relation_dir/data"
relation_file="$relation_dir/data"
if ! [ -e "$relation_file" ]; then
e "$rc" > "$relation_file"
chmod go-rwx "$relation_file" ## protecting this file
fi
echo "$relation_file"
}
}
export -f service:relation-file
export -f service:relation-file