Browse Source

chg: would fail without warning when charm is not found

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
test1
Valentin Lab 4 years ago
parent
commit
cb7a289ec5
  1. 11
      bin/compose-core

11
bin/compose-core

@ -1266,8 +1266,13 @@ get_compose_service_def () {
docker_compose=$(get_compose_yml_content) || return 1
result=$(_get_compose_service_def_cached "$service" "$docker_compose") || return 1
charm=$(echo "$result" | shyaml get-value charm 2>/dev/null) || return 1
metadata=$(charm.metadata "$charm") || return 1
if default_options=$(printf "%s" "$metadata" | shyaml -y -q get-value default-options); then
if charm.exists "$charm"; then
metadata=$(charm.metadata "$charm") || return 1
else
err "Charm $DARKPINK$charm$NORMAL not found in charm-store."
return 1
fi
if default_options=$(e "$metadata" | shyaml -y -q get-value default-options); then
default_options=$(yaml_key_val_str "options" "$default_options") || return 1
result=$(merge_yaml_str "$default_options" "$result") || return 1
fi
@ -2164,7 +2169,7 @@ _get_services_uses() {
for service in "$@"; do
_get_service_uses "$service" | while read-0 rn rd; do
printf "%s\0" "$service" "$rn" "$rd"
p0 "$service" "$rn" "$rd"
done
[ "${PIPESTATUS[0]}" == 0 ] || {
return 1

Loading…
Cancel
Save