summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2017-05-24 14:23:32 +0100
committerMark Goddard <mark@stackhpc.com>2017-06-16 14:52:39 +0100
commitdad5b6340a08705c6fdc4c8116393b0c0bb4b56d (patch)
tree85858a3f6ef2faded1b81c148280fc6aadd0c627
parent012696943a446b352ac1a5e4992034e75fb33ba0 (diff)
Use lowercase keys for swarm waitcondition signal
The heat waitcondition signal API accepts status, reason, data and id fields in a JSON object supplied as POST data. Missing fields will be filled with defaults. Previously, the swarm script fragments used a capitalised form of these keys (Status, Reason, Data, Id) which was not being recognised by heat. This caused failures to not be reported. This change uses the correct lowercase names for these fields and also fixes some quoting and incorrect use of UUIDs provided as the id field. Change-Id: I9bfe36e5dd956280eaa42d1c3f1620c4ec27bc0c Closes-Bug: #1504059
Notes
Notes (review): Code-Review+2: Spyros Trigazis (strigazi) <strigazi@gmail.com> Code-Review+2: Adrian Otto <aotto@aotto.com> Workflow+1: Adrian Otto <aotto@aotto.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 16 Jun 2017 16:14:00 +0000 Reviewed-on: https://review.openstack.org/474983 Project: openstack/magnum Branch: refs/heads/stable/newton
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/cfn-signal.sh4
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-cluster-failure-service.yaml2
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-swarm-agent-service.sh2
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-swarm-master-service.sh2
4 files changed, 5 insertions, 5 deletions
diff --git a/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/cfn-signal.sh b/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/cfn-signal.sh
index 8a3dd51..6913017 100644
--- a/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/cfn-signal.sh
+++ b/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/cfn-signal.sh
@@ -8,8 +8,8 @@ STATUS="SUCCESS"
8REASON="Setup complete" 8REASON="Setup complete"
9DATA="OK" 9DATA="OK"
10 10
11data=$(echo '{"Status": "'${STATUS}'", "Reason": "'$REASON'", "Data": "'${DATA}'", "UniqueId": "00000"}') 11data=$(echo '{"status": "'${STATUS}'", "reason": "'$REASON'", "data": "'${DATA}'", "id": "000000"}')
12 12
13curl -i -X POST -H "Content-Type: application/json" -H "X-Auth-Token: $WAIT_HANDLE_TOKEN" \ 13curl -i -X POST -H "Content-Type: application/json" -H "X-Auth-Token: $WAIT_HANDLE_TOKEN" \
14 --data-binary "'$data'" \ 14 --data-binary "$data" \
15 "$WAIT_HANDLE_ENDPOINT" 15 "$WAIT_HANDLE_ENDPOINT"
diff --git a/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-cluster-failure-service.yaml b/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-cluster-failure-service.yaml
index ad0e1c0..0fb7ec0 100644
--- a/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-cluster-failure-service.yaml
+++ b/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-cluster-failure-service.yaml
@@ -12,5 +12,5 @@ write_files:
12 Type=simple 12 Type=simple
13 TimeoutStartSec=0 13 TimeoutStartSec=0
14 ExecStart=/usr/bin/curl -i -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token: $WAIT_HANDLE_TOKEN' \ 14 ExecStart=/usr/bin/curl -i -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token: $WAIT_HANDLE_TOKEN' \
15 --data-binary "'"'{"Status": "FAILURE", "Reason": "$SERVICE service failed to start.", "Data": "OK", "UniqueId": "00000"}'"'" \ 15 --data-binary '{"status": "FAILURE", "reason": "$SERVICE service failed to start.", "data": "Failure", "id": "00000"}' \
16 "$WAIT_HANDLE_ENDPOINT" 16 "$WAIT_HANDLE_ENDPOINT"
diff --git a/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-swarm-agent-service.sh b/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-swarm-agent-service.sh
index ed2c05d..7f4c651 100644
--- a/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-swarm-agent-service.sh
+++ b/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-swarm-agent-service.sh
@@ -51,7 +51,7 @@ do
51done 51done
52 52
53curl -i -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token: $WAIT_HANDLE_TOKEN' \ 53curl -i -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token: $WAIT_HANDLE_TOKEN' \
54 --data-binary "'"'{"Status": "SUCCESS", "Reason": "Swarm agent ready", "Data": "OK", "UniqueId": "00000"}'"'" \ 54 --data-binary '{"status": "SUCCESS", "reason": "Swarm agent ready", "data": "OK", "id": "00000"}' \
55 "$WAIT_HANDLE_ENDPOINT" 55 "$WAIT_HANDLE_ENDPOINT"
56EOF 56EOF
57 57
diff --git a/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-swarm-master-service.sh b/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-swarm-master-service.sh
index 5d3569c..359f8ef 100644
--- a/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-swarm-master-service.sh
+++ b/magnum/drivers/swarm_fedora_atomic_v1/templates/fragments/write-swarm-master-service.sh
@@ -39,7 +39,7 @@ cat >> /etc/systemd/system/swarm-manager.service << END_SERVICE_BOTTOM
39 etcd://$ETCD_SERVER_IP:2379/v2/keys/swarm/ 39 etcd://$ETCD_SERVER_IP:2379/v2/keys/swarm/
40ExecStop=/usr/bin/docker stop swarm-manager 40ExecStop=/usr/bin/docker stop swarm-manager
41ExecStartPost=/usr/bin/curl -i -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token: $WAIT_HANDLE_TOKEN' \\ 41ExecStartPost=/usr/bin/curl -i -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token: $WAIT_HANDLE_TOKEN' \\
42 --data-binary "'"'{"Status": "SUCCESS", "Reason": "Setup complete", "Data": "OK", "UniqueId": "00000"}'"'" \\ 42 --data-binary '{"status": "SUCCESS", "reason": "Setup complete", "data": "OK", "id": "00000"}' \\
43 "$WAIT_HANDLE_ENDPOINT" 43 "$WAIT_HANDLE_ENDPOINT"
44 44
45[Install] 45[Install]