novarc improvement

Bug #684657 reported by Chmouel Boudjnah
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Wishlist
Chmouel Boudjnah

Bug Description

novarc is currently trying to redefine an alias using /usr/bin/ec2-* tools when on my ubuntu maverick this is using /usr/bin/euca-* I am assuming this was renamed somewhere so probably could handle both case.

another low priority thing is that the novarc is very bashist and for the other shell user out there like zsh they would not have a BASH_SOURCE defined.

Related branches

Changed in nova:
assignee: nobody → Chmouel Boudjnah (chmouel)
status: New → In Progress
Revision history for this message
Chmouel Boudjnah (chmouel) wrote :
Download full text (4.7 KiB)

On 03/12/10 14:52, Soren Hansen wrote:
> > 2010/12/3 Chmouel Boudjnah <email address hidden>:
>> >> === modified file 'nova/auth/novarc.template'
>> >> --- nova/auth/novarc.template 2010-07-15 15:52:11 +0000
>> >> +++ nova/auth/novarc.template 2010-12-03 14:23:53 +0000
>> >> @@ -1,3 +1,5 @@
>> >> +[ -n $BASH_SOURCE ] || BASH_SOURCE=$(readlink -f $0)
>> >> +
This is only for bash for zsh $0 would be the sourced script name. IE:

chmouel@lutece:~$ echo $ZSH_VERSION
4.3.10-dev-1-cvs0720
chmouel@lutece:~$ cat /tmp/a.zsh
echo $0
chmouel@lutece:~$ source /tmp/a.zsh
/tmp/a.zsh
chmouel@lutece:~$ bash --login
chmouel@lutece:~$ source /tmp/a.zsh
bash
chmouel@lutece:~$

> > This won't work. novarc is sourced, not run as a script, so $0
> > is "bash" or something like that. What you need is an equivalent
> > of __file__.
> >
>> >> -alias ec2-bundle-image="ec2-bundle-image --cert ${EC2_CERT} --privatekey ${EC2_PRIVATE_KEY} --user 42 --ec2cert ${NOVA_CERT}"
>> >> -alias ec2-upload-bundle="ec2-upload-bundle -a ${EC2_ACCESS_KEY} -s ${EC2_SECRET_KEY} --url ${S3_URL} --ec2cert ${NOVA_CERT}"
>> >> +
>> >> +[ -x /usr/bin/ec2-bundle-image ] && E_B_IMG=/usr/bin/ec2-bundle-image || E_B_IMG=/usr/bin/euca-bundle-image
>> >> +[ -x /usr/bin/ec2-upload-image ] && E_U_IMG=/usr/bin/ec2-upload-bundle || E_U_IMG=/usr/bin/euca-upload-bundle
>> >> +
>> >> +alias ${E_B_IMG}="${E_B_IMG} --cert ${EC2_CERT} --privatekey ${EC2_PRIVATE_KEY} --user 42 --ec2cert ${NOVA_CERT}"
>> >> +alias ${E_U_IMG}="${E_U_IMG} -a ${EC2_ACCESS_KEY} -s ${EC2_SECRET_KEY} --url ${S3_URL} --ec2cert ${NOVA_CERT}"
> >
> > I'm not sure this is necessary. I've succesfully run euca-*bundle*
> > without any problems without this fix?
I have just installed a ubuntu maverick from scratch and the euca2ool
from maverick and it does not seem to be present :

chmouel@chmoutest:~$ dpkg --get-selections|grep euca2ools
chmouel@chmoutest:~$ sudo aptitude -y install euca2ools
The following NEW packages will be installed:
  cloud-utils{a} euca2ools libyaml-0-2{a} python-boto{a} python-crypto{a}
  python-m2crypto{a} python-paramiko{a} python-yaml{a}
0 packages upgraded, 8 newly installed, 0 to remove and 32 not upgraded.
Need to get 1,672kB of archives. After unpacking 12.4MB will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu/ maverick/main python-m2crypto
amd64 0.20.1-1ubuntu4 [206kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu/ maverick/main python-boto all
1.9b-1ubuntu3 [182kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu/ maverick/main euca2ools all
1.2-0ubuntu11 [74.4kB]
Get:4 http://gb.archive.ubuntu.com/ubuntu/ maverick/main libyaml-0-2
amd64 0.1.3-1 [55.0kB]
Get:5 http://gb.archive.ubuntu.com/ubuntu/ maverick/main python-crypto
amd64 2.0.1+dfsg1-4ubuntu2 [187kB]
Get:6 http://gb.archive.ubuntu.com/ubuntu/ maverick/main python-paramiko
all 1.7.6-2 [819kB]
Get:7 http://gb.archive.ubuntu.com/ubuntu/ maverick/main python-yaml
amd64 3.09-4build1 [124kB]
Get:8 http://gb.archive.ubuntu.com/ubuntu/ maverick/main cloud-utils all
0.16ubuntu1 [24.6kB]
Fetched 1,672kB in 0s (3,662kB/s)
Selecting previously deselected package python-m2crypto.
(Reading database ... 25444 files and directories currently installed.)
Unpackin...

Read more...

Revision history for this message
Thierry Carrez (ttx) wrote :

The euca-* tools don't need an alias (they use the env). Only the ec2-* tools need the extra parameters...
Marking as wontfix, feel free to reopen if you disagree :)

Changed in nova:
importance: Undecided → Wishlist
status: In Progress → Won't Fix
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.