euca2ools config file overrides environment
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/
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_
EC2_ACCESS_
EC2_USER_ID=123456
$ cat user.eucarc
EC2_SECRET_
EC2_ACCESS_
EC2_USER_
$ ln -s user.eucarc ~/.eucarc
$ ./run.sh admin euca-describe-
$ ./run.sh user euca-describe-
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
ProcVersionSign
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)
PackageArchitec
ProcEnviron:
PATH=(custom, user)
LANG=en_US.utf8
SHELL=/bin/bash
SourcePackage: euca2ools
Changed in euca2ools (Ubuntu): | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
Changed in euca2ools (Ubuntu): | |
status: | Confirmed → Won't Fix |
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 images --config user.eucarc
euca-describe-
or am I missing something ?