Browse code

Handle the new behaviour for invalid instances.

The behaviour of this case changed with bug/836978. Requesting the
status of an invalid instance will now return an error message
including the instance id, so we need to filter that out.

Resolves the devstack elements of bug 836978.

Change-Id: I385eb6f04cff90e1ddc0b79d835fbbdf92e4e9ff

Michael Still authored on 2012/12/28 09:08:20
Showing 1 changed files
... ...
@@ -165,8 +165,11 @@ fi
165 165
 euca-terminate-instances $INSTANCE || \
166 166
     die "Failure terminating instance $INSTANCE"
167 167
 
168
-# Assure it has terminated within a reasonable time
169
-if ! timeout $TERMINATE_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q $INSTANCE; do sleep 1; done"; then
168
+# Assure it has terminated within a reasonable time. The behaviour of this
169
+# case changed with bug/836978. Requesting the status of an invalid instance
170
+# will now return an error message including the instance id, so we need to
171
+# filter that out.
172
+if ! timeout $TERMINATE_TIMEOUT sh -c "while euca-describe-instances $INSTANCE |grep -v \"InstanceNotFound\" | grep -q $INSTANCE; do sleep 1; done"; then
170 173
     echo "server didn't terminate within $TERMINATE_TIMEOUT seconds"
171 174
     exit 1
172 175
 fi