]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
sepia-fog-images: Remove finished hostnames properly
authorDavid Galloway <dgallowa@redhat.com>
Tue, 27 Feb 2018 00:08:39 +0000 (19:08 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Tue, 27 Feb 2018 00:14:50 +0000 (19:14 -0500)
Before this change, if there were 3+ hosts in $remaininghosts and one of
the hostnames in the middle finished, sed would remove the hostname and
its trailing space which would mash the last two hostnames together.

```
Example:

remaininghosts="mira071 smithi164 mira001"
remaininghosts=$(echo $remaininghosts | sed -e "s/ *smithi164 *//")
$ echo $remaininghosts
mira071mira001
```

Signed-off-by: David Galloway <dgallowa@redhat.com>
sepia-fog-images/build/build

index 61037e36ac490bc37b3a780d3ede8404b1be7abb..39e865604856aa181c111b2e2339b3cb6d3ecd5b 100755 (executable)
@@ -136,7 +136,7 @@ while [ "$remaininghosts" != "" ]; do
       ssh ubuntu@store01.front.sepia.ceph.com "sudo /usr/local/sbin/set-next-server.sh $host fog"
       # Prep the host for FOG image capture
       ansible-playbook $WORKSPACE/ceph-cm-ansible/tools/prep-fog-capture.yml -e ansible_ssh_user=ubuntu --limit="$host*"
-      remaininghosts=$(echo $remaininghosts | sed -e "s/ *$host *//")
+      remaininghosts=${remaininghosts//$host/}
     else
       # This gets noisy
       set +ex