novarc improvement
Bug #684657 reported by
Chmouel Boudjnah
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
lp:~chmouel/nova/lp684657
Rejected
for merging
into
lp:~hudson-openstack/nova/trunk
- Eric Day (community): Needs Information
- Thierry Carrez (community): Disapprove
-
Diff: 21 lines (+8/-2)1 file modifiednova/auth/novarc.template (+8/-2)
Changed in nova: | |
assignee: | nobody → Chmouel Boudjnah (chmouel) |
status: | New → In Progress |
To post a comment you must log in.
On 03/12/10 14:52, Soren Hansen wrote: novarc. template' novarc. template 2010-07-15 15:52:11 +0000 novarc. template 2010-12-03 14:23:53 +0000 $(readlink -f $0)
> > 2010/12/3 Chmouel Boudjnah <email address hidden>:
>> >> === modified file 'nova/auth/
>> >> --- nova/auth/
>> >> +++ nova/auth/
>> >> @@ -1,3 +1,5 @@
>> >> +[ -n $BASH_SOURCE ] || BASH_SOURCE=
>> >> +
This is only for bash for zsh $0 would be the sourced script name. IE:
chmouel@lutece:~$ echo $ZSH_VERSION dev-1-cvs0720
4.3.10-
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 image=" ec2-bundle- image --cert ${EC2_CERT} --privatekey ${EC2_PRIVATE_KEY} --user 42 --ec2cert ${NOVA_CERT}" bundle= "ec2-upload- bundle -a ${EC2_ACCESS_KEY} -s ${EC2_SECRET_KEY} --url ${S3_URL} --ec2cert ${NOVA_CERT}" ec2-bundle- image ] && E_B_IMG= /usr/bin/ ec2-bundle- image || E_B_IMG= /usr/bin/ euca-bundle- image ec2-upload- image ] && E_U_IMG= /usr/bin/ ec2-upload- bundle || E_U_IMG= /usr/bin/ euca-upload- bundle ="${E_B_ IMG} --cert ${EC2_CERT} --privatekey ${EC2_PRIVATE_KEY} --user 42 --ec2cert ${NOVA_CERT}" ="${E_U_ IMG} -a ${EC2_ACCESS_KEY} -s ${EC2_SECRET_KEY} --url ${S3_URL} --ec2cert ${NOVA_CERT}"
> > is "bash" or something like that. What you need is an equivalent
> > of __file__.
> >
>> >> -alias ec2-bundle-
>> >> -alias ec2-upload-
>> >> +
>> >> +[ -x /usr/bin/
>> >> +[ -x /usr/bin/
>> >> +
>> >> +alias ${E_B_IMG}
>> >> +alias ${E_U_IMG}
> >
> > 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-selection s|grep euca2ools chmoutest: ~$ sudo aptitude -y install euca2ools m2crypto{ a} python-paramiko{a} python-yaml{a} gb.archive. ubuntu. com/ubuntu/ maverick/main python-m2crypto gb.archive. ubuntu. com/ubuntu/ maverick/main python-boto all gb.archive. ubuntu. com/ubuntu/ maverick/main euca2ools all gb.archive. ubuntu. com/ubuntu/ maverick/main libyaml-0-2 gb.archive. ubuntu. com/ubuntu/ maverick/main python-crypto 4ubuntu2 [187kB] gb.archive. ubuntu. com/ubuntu/ maverick/main python-paramiko gb.archive. ubuntu. com/ubuntu/ maverick/main python-yaml gb.archive. ubuntu. com/ubuntu/ maverick/main cloud-utils all
chmouel@
The following NEW packages will be installed:
cloud-utils{a} euca2ools libyaml-0-2{a} python-boto{a} python-crypto{a}
python-
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://
amd64 0.20.1-1ubuntu4 [206kB]
Get:2 http://
1.9b-1ubuntu3 [182kB]
Get:3 http://
1.2-0ubuntu11 [74.4kB]
Get:4 http://
amd64 0.1.3-1 [55.0kB]
Get:5 http://
amd64 2.0.1+dfsg1-
Get:6 http://
all 1.7.6-2 [819kB]
Get:7 http://
amd64 3.09-4build1 [124kB]
Get:8 http://
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...