euca2ools config file overrides environment

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

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
. ${1}.eucarc
exec "${@}"
$ cat admin.eucarc
$ cat user.eucarc
$ ln -s user.eucarc ~/.eucarc

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

the problem is that both of the above '' 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
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
 PATH=(custom, user)
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,

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