"die" is not a valid bash command
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cisco Openstack |
Fix Released
|
Low
|
Mark T. Voelker | ||
Folsom |
Fix Committed
|
Low
|
Mark T. Voelker | ||
Grizzly |
Fix Released
|
Low
|
Mark T. Voelker |
Bug Description
The create_vm and net_setup test scripts we include in the quantum-l3-test repo make frequent use of "die".
root@cvf2-
create_vm: die "There don't seem to be any 'compute' hosts available, perhaps run puppet agent on them again?"
create_vm: die "The vm failed to build."
net_setup:function die ( ) {
net_setup: die "Please enter a valid public ip"
net_setup: die "Please enter a valid public ip"
net_setup: die "Please enter a valid ip address"
net_setup:[ -z "${PUB_NET_ID}" ] || die 'Delete your networks and try again'
root@cvf2-
However, die is not a valid bash command. That means that if the user runs into an error condition he simply sees a message stating that die isn't a valid bash command and the script continues instead of exiting. We probably want to separate that into "echo" and "exit" statements like so:
echo "There don't seem to be any 'compute' hosts available, perhaps run puppet agent on them again?"
exit 1
One minor correction: this is only a problem for create_vm. In net_setup there's a die function defined:
mvoelker@ mvoelker- lnx1:~/ openstack/ quantum- l3-test$ grep -A 3 'function die' net_setup mvoelker- lnx1:~/ openstack/ quantum- l3-test$
function die ( ) {
echo $@
exit 1
}
mvoelker@