]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Account for XML output in Getting Started script
authorZane Bitter <zbitter@redhat.com>
Sun, 15 Jul 2012 21:04:45 +0000 (17:04 -0400)
committerZane Bitter <zbitter@redhat.com>
Sun, 15 Jul 2012 21:52:01 +0000 (17:52 -0400)
The output format of heat commands has changed from JSON to XML

Change-Id: I68b4011e31fdb14306e88506dc6ff819b041b054
Signed-off-by: Zane Bitter <zbitter@redhat.com>
docs/GettingStarted.rst

index d3805011f21721628f03b76ecd707a3286001faa..8219387ec64631943c3181c153d513d3e6e507b0 100644 (file)
@@ -232,16 +232,15 @@ After a few seconds, the ``StackStatus`` should change from ``IN_PROGRESS`` to `
 
 ..
     # Wait for Stack creation
-    CREATING='"StackStatus": "IN_PROGRESS"'
+    CREATING="<StackStatus>IN_PROGRESS</StackStatus>"
     retries=24
-    while $HEAT_DESCRIBE | grep -q '"StackStatus": "IN_PROGRESS"' &&          \
-          ((retries-- > 0))
+    while $HEAT_DESCRIBE | grep -q $CREATING && ((retries-- > 0))
     do
         echo "Waiting for Stack creation to complete..." >&2
         sleep 5
     done
     
-    $HEAT_DESCRIBE | grep -q '"StackStatus": "CREATE_COMPLETE"'
+    $HEAT_DESCRIBE | grep -q "<StackStatus>CREATE_COMPLETE</StackStatus>"
     
 
 Verify instance creation
@@ -250,11 +249,14 @@ Verify instance creation
 Because the software takes some time to install from the repository, it may be a few minutes before the Wordpress intance is in a running state.  One way to check is to login via ssh and ``tail -f /var/log/yum.log``.  Once ``mysql-server`` installs, the instance should be ready to go.
 
 ..
-    WebsiteURL=$($HEAT_DESCRIBE | sed -e '/"OutputKey": "WebsiteURL"/,/}/ {'  \
-                                      -e '/"OutputValue":/ {'                 \
-                                      -e 's/[^:]*": "//'                      \
-                                      -e 's/",\?[[:space:]]*$//'              \
-                                      -e p -e '}' -e '}' -e d)
+    WebsiteURL=$($HEAT_DESCRIBE | sed                             \
+        -e '/<OutputKey>WebsiteURL<\/OutputKey>/,/<\/member>/ {'  \
+        -e '/<OutputValue>/ {'                                    \
+        -e 's/<OutputValue>\([^<]*\)<\/OutputValue>/\1/'          \
+        -e p                                                      \
+        -e '}' -e '}'                                             \
+        -e d                                                      \
+    )
     HOST=`echo $WebsiteURL | sed -r -e 's#http://([^/]+)/.*#\1#'`
     
     retries=9