getopt disorder output induce unrecognized arch

Bug #1259740 reported by Kui Shi
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Kui Shi

Bug Description

For the file "tripleo-incubator/scripts/boot-seed-vm", there is a commit which add "i" option:

commit 444c63128d0354c97d66a3bb5b8e23ea39633bbb
    Add image already exists option to boot-seed-vm

The following change will disorder the getopt output:

-TEMP=`getopt -o hcna:o:s:b:e: -l use-existing-vm -n $SCRIPT_NAME -- "$@"`
+TEMP=`getopt -o hcnai:o:s:b:e: -l use-existing-vm -n $SCRIPT_NAME -- "$@"`

Here is error debug message:

++ getopt -o hcnai:o:s:b:e: -l use-existing-vm -n boot-seed-vm -- -a i386 ubuntu neutron-dhcp-agent
+ TEMP=' -a -- '\''i386'\'' '\''ubuntu'\'' '\''neutron-dhcp-agent'\'''
+ '[' 0 '!=' 0 ']'
+ eval set -- ' -a -- '\''i386'\'' '\''ubuntu'\'' '\''neutron-dhcp-agent'\'''
++ set -- -a -- i386 ubuntu neutron-dhcp-agent
+ true
+ case "$1" in
+ export ARCH=--
+ ARCH=--
+ shift 2
+ true
+ case "$1" in
+ echo 'Error: unsupported option i386.'
Error: unsupported option i386.

Here is a workaround for this:

@@ -61,7 +62,7 @@ function show_options () {
     exit 0
 }

-TEMP=`getopt -o hcnai:o:s:b:e: -l use-existing-vm -n $SCRIPT_NAME -- "$@"`
+TEMP=`getopt -o ihcna:o:s:b:e: -l use-existing-vm -n $SCRIPT_NAME -- "$@"`
 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi

 # Note the quotes around `$TEMP': they are essential!

Kui Shi (skuicloud)
Changed in tripleo:
assignee: nobody → Kui Shi (skuicloud)
aeva black (tenbrae)
Changed in tripleo:
status: New → Triaged
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-incubator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/61271

Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :
Changed in tripleo:
status: In Progress → Fix Committed
Changed in tripleo:
status: Fix Committed → Fix Released
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.