Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions fragments/common_functions.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
# Send success status to OpenStack WaitCondition
# or UpdateWaitConditionHandle
function notify_success() {
$WC_NOTIFY --data-binary \
"{\"status\": \"SUCCESS\", \"reason\": \"$1\", \"data\": \"$1\"}"
if [[ "$WC_NOTIFY" =~ ^curl ]]; then
$WC_NOTIFY -k --data-binary \
"{\"status\": \"SUCCESS\", \"reason\": \"$1\", \"data\": \"$1\"}"
else
/usr/bin/cfn-signal -e 0 -r "$1" -s "SUCCESS" --id "00000" -d "$1" "$WC_NOTIFY"
fi
exit 0
}

# Send success status to OpenStack WaitCondition
# Send failure status to OpenStack WaitCondition
# or UpdateWaitConditionHandle
function notify_failure() {
$WC_NOTIFY --data-binary \
if [[ "$WC_NOTIFY" =~ ^curl ]]; then

$WC_NOTIFY -k --data-binary \
"{\"status\": \"FAILURE\", \"reason\": \"$1\", \"data\": \"$1\"}"
else
/usr/bin/cfn-signal -r "$1" -s "FAILURE" -r "$1" --id "00000" -d "$1" "$WC_NOTIFY"
fi
exit 1
}

Expand Down
4 changes: 2 additions & 2 deletions node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ resources:
content:
str_replace:
params:
$WC_NOTIFY: { get_attr: ['wait_handle', 'curl_cli'] }
$WC_NOTIFY: { get_resource: wait_handle }
template: {get_file: fragments/common_functions.sh}
- path: /usr/local/share/openshift-on-openstack/common_openshift_functions.sh
permissions: 0755
Expand Down Expand Up @@ -766,7 +766,7 @@ resources:
# Provide a curl CLI command to the cloud-init script. Called on completion
# to indicate the status of the cloud-init process
wait_handle:
type: OS::Heat::WaitConditionHandle
type: OS::Heat::UpdateWaitConditionHandle

outputs:
hostname:
Expand Down