Skip to content

Commit

Permalink
When not found, return empty string
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Zeithaml <[email protected]>
  • Loading branch information
Martin-Zeithaml committed Nov 15, 2024
1 parent d91e5d9 commit 0101282
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/libs/json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ read_yaml_configmgr() {
result=$(_CEE_RUNOPTS="XPLINK(ON)" "${configmgr}" -s "$schema" -p "FILE(${file})" extract "${key}" 2>&1);
code=$?

# When the item is not defined in config, configmgr returns
# code 0 and
# stdout = "error not found, reason=nnn"
if [[ "${result}" == "error not found, reason="* ]]; then
result=""
fi

print_trace " * Exit code: ${code}"
print_trace " * Output:"
print_trace "$(padding_left "${result}" " ")"
Expand Down

0 comments on commit 0101282

Please sign in to comment.