Skip to content

Commit

Permalink
Adding required is_true function and fixing log
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel <dgarcia@opennebula.io>
  • Loading branch information
dgarcia18 committed Apr 29, 2024
1 parent 9b248ee commit 3a022a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions appliances/lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,16 @@ $(echo "${ONE_SERVICE_DESCRIPTION}" | sed -e 's/^\(.\)/ \1/')
EOF

}

# arg: <variable name>
is_true()
{
_value=$(eval echo "\$${1}" | tr '[:upper:]' '[:lower:]')
case "$_value" in
1|true|yes|y)
return 0
;;
esac

return 1
}
2 changes: 1 addition & 1 deletion appliances/lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ _check_service_status()
msg info "Starting reconfiguration of the service"
return 0
else
msg error "Configure step cannot be run - go check: ${ONE_SERVICE_STATUS}"
msg error "Configure step will not run since the appliance is set as non-reconfigurable. Chech the value of ONE_SERVICE_RECONFIGURABLE"
exit 1
fi
;;
Expand Down

0 comments on commit 3a022a9

Please sign in to comment.