> > 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
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 m2crypto_ 0.20.1- 1ubuntu4_ amd64.deb) ... boto_1. 9b-1ubuntu3_ all.deb) ... 1.2-0ubuntu11_ all.deb) ... 0-2_0.1. 3-1_amd64. deb) ... crypto_ 2.0.1+dfsg1- 4ubuntu2_ amd64.deb) ... paramiko_ 1.7.6-2_ all.deb) ... yaml_3. 09-4build1_ amd64.deb) ... utils_0. 16ubuntu1_ all.deb) ... dfsg1-4ubuntu2) ...
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.)
Unpacking python-m2crypto (from
.../python-
Selecting previously deselected package python-boto.
Unpacking python-boto (from .../python-
Selecting previously deselected package euca2ools.
Unpacking euca2ools (from .../euca2ools_
Selecting previously deselected package libyaml-0-2.
Unpacking libyaml-0-2 (from .../libyaml-
Selecting previously deselected package python-crypto.
Unpacking python-crypto (from
.../python-
Selecting previously deselected package python-paramiko.
Unpacking python-paramiko (from .../python-
Selecting previously deselected package python-yaml.
Unpacking python-yaml (from .../python-
Selecting previously deselected package cloud-utils.
Unpacking cloud-utils (from .../cloud-
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+
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 ec2-bundle- image: No such file or directory
ls: cannot access /usr/bin/
Chmouel