@@ -23,16 +23,16 @@ print_help() {
23
23
echo -e ' Spin a server on OpenStack'
24
24
echo
25
25
echo -e ' Usage:'
26
- echo -e " \t${0} [-p] - f <flavor> -i <image> -e <external network> -k <key > NAME"
26
+ echo -e " \t${0} [-p] [-k <key>] - f <flavor> -i <image> -e <external network> NAME"
27
27
echo
28
28
echo -e ' Required parameters:'
29
29
echo -e ' \t-f\tFlavor of the Compute instance.'
30
30
echo -e ' \t-i\tImage of the Compute instance.'
31
31
echo -e ' \t-e\tName or ID of the public network where to create the floating IP.'
32
- echo -e ' \t-k\tName or ID of the SSH public key to add to the server.'
33
32
echo -e ' \tNAME: name to give to the OpenStack resources.'
34
33
echo
35
34
echo -e ' Optional parameters:'
35
+ echo -e ' \t-k\tName or ID of the SSH public key to add to the server.'
36
36
echo -e ' \t-d\tRun the script in debug mode'
37
37
echo -e ' \t-p\tDo not clean up the server after creation'
38
38
echo -e ' \t\t(will print a cleanup script instead of executing it).'
@@ -215,8 +215,10 @@ server_create_args=(
215
215
--flavor " $server_flavor "
216
216
--nic " port-id=$port_id "
217
217
--security-group " $sg_id "
218
- --key-name " $key_name "
219
218
)
219
+ if [ -n " $key_name " ]; then
220
+ server_create_args+=(--key-name " $key_name " )
221
+ fi
220
222
if [ " $liveness " == ' yes' ]; then
221
223
server_create_args+=(--user-data " ${script_dir} /connectivity-test-cloud-init.yaml" )
222
224
fi
@@ -263,7 +265,7 @@ for driver in "${!drivers[@]}"; do
263
265
# propagated to the network hardware yet, which curl cannot.
264
266
start=$( date +%s)
265
267
backoff=1
266
- while ! curl --fail-with-body http://" $fip_address " /; do
268
+ while ! curl --fail-with-body --no-progress-meter http://" $fip_address " /; do
267
269
# This normally succeeds immediately, but we allow it up to
268
270
# 300 seconds.
269
271
if [ $(( $(date +% s)- start )) -gt 300 ]; then
0 commit comments