Comment 1 for bug 684657

Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

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.)
Unpacking python-m2crypto (from
.../python-m2crypto_0.20.1-1ubuntu4_amd64.deb) ...
Selecting previously deselected package python-boto.
Unpacking python-boto (from .../python-boto_1.9b-1ubuntu3_all.deb) ...
Selecting previously deselected package euca2ools.
Unpacking euca2ools (from .../euca2ools_1.2-0ubuntu11_all.deb) ...
Selecting previously deselected package libyaml-0-2.
Unpacking libyaml-0-2 (from .../libyaml-0-2_0.1.3-1_amd64.deb) ...
Selecting previously deselected package python-crypto.
Unpacking python-crypto (from
.../python-crypto_2.0.1+dfsg1-4ubuntu2_amd64.deb) ...
Selecting previously deselected package python-paramiko.
Unpacking python-paramiko (from .../python-paramiko_1.7.6-2_all.deb) ...
Selecting previously deselected package python-yaml.
Unpacking python-yaml (from .../python-yaml_3.09-4build1_amd64.deb) ...
Selecting previously deselected package cloud-utils.
Unpacking cloud-utils (from .../cloud-utils_0.16ubuntu1_all.deb) ...
Processing triggers for man-db ...
Setting up python-m2crypto (0.20.1-1ubuntu4) ...
Setting up python-boto (1.9b-1ubuntu3) ...
Setting up euca2ools (1.2-0ubuntu11) ...
Setting up libyaml-0-2 (0.1.3-1) ...
Setting up python-crypto (2.0.1+dfsg1-4ubuntu2) ...
Setting up python-yaml (3.09-4build1) ...
Processing triggers for python-central ...
Setting up python-paramiko (1.7.6-2) ...
Setting up cloud-utils (0.16ubuntu1) ...
Processing triggers for python-support ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

chmouel@chmoutest:~$ ls /usr/bin/ec2-bundle-image
ls: cannot access /usr/bin/ec2-bundle-image: No such file or directory

Chmouel