Merge "Make ssh commands stateless"
This commit is contained in:
commit
2eaf7fb2f8
@ -128,5 +128,9 @@ function exit_trap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Don't check or store host keys, and auto-accept whatever we connect to
|
||||||
|
FSSH="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
||||||
|
|
||||||
|
|
||||||
# Restore xtrace
|
# Restore xtrace
|
||||||
$XTRACE
|
$XTRACE
|
||||||
|
@ -130,7 +130,7 @@ function create {
|
|||||||
set +o errexit
|
set +o errexit
|
||||||
local timeleft=30
|
local timeleft=30
|
||||||
while [[ $timeleft -gt 0 ]]; do
|
while [[ $timeleft -gt 0 ]]; do
|
||||||
ssh -o "StrictHostKeyChecking no" -i $CINDER_KEY_FILE cirros@$ip \
|
$FSSH -i $CINDER_KEY_FILE cirros@$ip \
|
||||||
"echo '$CINDER_STATE' > $CINDER_STATE_FILE"
|
"echo '$CINDER_STATE' > $CINDER_STATE_FILE"
|
||||||
local rc=$?
|
local rc=$?
|
||||||
|
|
||||||
@ -161,9 +161,9 @@ function verify_noapi {
|
|||||||
ping_check_public $server_ip 30
|
ping_check_public $server_ip 30
|
||||||
# this sync is here to ensure that we don't accidentally pass when
|
# this sync is here to ensure that we don't accidentally pass when
|
||||||
# the volume is actually down.
|
# the volume is actually down.
|
||||||
timeout 30 ssh -o "StrictHostKeyChecking no" -i $CINDER_KEY_FILE cirros@$server_ip \
|
timeout 30 $FSSH -i $CINDER_KEY_FILE cirros@$server_ip \
|
||||||
"sync"
|
"sync"
|
||||||
local state=$(ssh -o "StrictHostKeyChecking no" -i $CINDER_KEY_FILE cirros@$server_ip \
|
local state=$($FSSH -i $CINDER_KEY_FILE cirros@$server_ip \
|
||||||
"cat $CINDER_STATE_FILE")
|
"cat $CINDER_STATE_FILE")
|
||||||
if [[ "$state" != "$CINDER_STATE" ]]; then
|
if [[ "$state" != "$CINDER_STATE" ]]; then
|
||||||
die $LINENO "The expected state left in the volume isn't there!"
|
die $LINENO "The expected state left in the volume isn't there!"
|
||||||
|
Loading…
Reference in New Issue
Block a user