"die" is not a valid bash command

Bug #1155663 reported by Mark T. Voelker
8
This bug affects 1 person
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-server-f1:/home/administrator/quantum-l3-test# grep die *
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-server-f1:/home/administrator/quantum-l3-test#

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

Revision history for this message
Mark T. Voelker (mvoelker) wrote :

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
function die ( ) {
  echo $@
  exit 1
}
mvoelker@mvoelker-lnx1:~/openstack/quantum-l3-test$

Revision history for this message
Mark T. Voelker (mvoelker) wrote :
Revision history for this message
Robert Starmer (starmer) wrote : Re: [Bug 1155663] [NEW] "die" is not a valid bash command

There's an update to the scripts that seems to keep disappearing (or that I keep thinking I'e pulled/merged) that has die as a function (it's a function in the network script already).

R

On Mar 15, 2013, at 3:39 PM, Launchpad Bug Tracker <email address hidden>
 wrote:

> You have been subscribed to a public bug by Mark T. Voelker (mvoelker):
>
> The create_vm and net_setup test scripts we include in the
> quantum-l3-test repo make frequent use of "die".
>
> root@cvf2-server-f1:/home/administrator/quantum-l3-test# grep die *
> 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-server-f1:/home/administrator/quantum-l3-test#
>
> 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
>
> ** Affects: openstack-cisco
> Importance: Low
> Assignee: Mark T. Voelker (mvoelker)
> Status: Triaged
>
> --
> "die" is not a valid bash command
> https://bugs.launchpad.net/bugs/1155663
> You received this bug notification because you are subscribed to the bug report.

Revision history for this message
Chris Ricker (chris-ricker) wrote :

Merged pull request resolves for both Grizzly and Folsom

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.