euca2ools config file overrides environment

Bug #556528 reported by Scott Moser
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
euca2ools (Ubuntu)
Won't Fix
Wishlist
Unassigned

Bug Description

Binary package hint: euca2ools

config file support that was added to euca2ools under bug 485106 . as described there,

| Order of preference is user supplied config file (--config) followed by $HOME/.eucarc
| followed by /etc/euca2ools/eucarc followed by the environment.

If a user has a $HOME/.eucarc file they cannot override that config file with environment variables.

I've run into this when trying to operate with multiple accounts by modifying environment variables. If I have a ~/.eucarc, then that functionality is broken. I was trying something like:

$ cat run.sh
. ${1}.eucarc
shift
export EC2_SECRET_KEY EC2_ACCESS_KEY
exec "${@}"
$ cat admin.eucarc
EC2_SECRET_KEY=abcdeft
EC2_ACCESS_KEY=abcdefg
EC2_USER_ID=123456
$ cat user.eucarc
EC2_SECRET_KEY=hijklmnop
EC2_ACCESS_KEY=jijklmnop
EC2_USER_ID=789101112
$ ln -s user.eucarc ~/.eucarc

$ ./run.sh admin euca-describe-images
$ ./run.sh user euca-describe-images

the problem is that both of the above 'run.sh' programs will use the information found in ~/.eucarc (because of the symlink to user.eucarc).

I'm struggling to think of another tool that reads a config file and environment variables to supply as an example on how it "should work".

One thing to note, though, the above can be made to work by putting user.eucarc and admin.eucarc in their own directories named '.eucarc' and setting HOME to that directory. Then, the default config will read HOME and pick up the desired config.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: euca2ools 1.2-0ubuntu9
ProcVersionSignature: Ubuntu 2.6.32-17.26-generic 2.6.32.10+drm33.1
Uname: Linux 2.6.32-17-generic x86_64
Architecture: amd64
Date: Tue Apr 6 09:38:26 2010
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta amd64 (20100318)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: euca2ools

Revision history for this message
Scott Moser (smoser) wrote :
Thierry Carrez (ttx)
Changed in euca2ools (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Thierry Carrez (ttx) wrote :

I'm not sure it's worth diverging from upstream here. Sounds like this should be solved by using the --config flag :

euca-describe-images --config admin.eucarc
euca-describe-images --config user.eucarc

or am I missing something ?

Revision history for this message
Scott Moser (smoser) wrote :

If --config works as expected, I have no objection to closing this as 'wont fix'.

Thierry Carrez (ttx)
Changed in euca2ools (Ubuntu):
status: Confirmed → Won't Fix
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

(This is completely wrong, and should be fixed upstream, but in any case: )

Note that the manpages say

Euca2ools will use the environment variables EC2_URL, EC2_ACCESS_KEY,
       EC2_SECRET_KEY, EC2_CERT, EC2_PRIVATE_KEY, S3_URL, EUCALYPTUS_CERT by
       default.

So at least they should be fixed to warn about this bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers