[Bug 526591] [NEW] euca2ools parsing of config file is severely limited
Scott Moser
smoser at canonical.com
Tue Feb 23 18:00:28 GMT 2010
Public bug reported:
Binary package hint: euca2ools
The euca2ools reading of user or system config file is very limited.
The reason for this is that the config file is bash syntax (expected to
be sourced by bash in .bash_profile or such), but the parsing is a
limited parsing done with python and string replacements (see
euca2ools/__init__.py:setup_environ):
~ line 360
| if read_config:
| lines = eucarc.readlines()
| comment = re.compile('^#')
| for line in lines:
| line = line.strip('export')
| line = line.replace('\'', '')
| line = line.strip()
| line = line.replace('${EUCA_KEY_DIR}', base_path)
| if not comment.match(line):
| parts = line.split('=', 1)
| if len(parts) == 2:
| self.environ[parts[0]] = parts[1]
The following easily demonstrates the issue:
$ mkdir euca && cd euca
$ sudo euca_conf --get-credentials mycreds.zip
$ unzip mycreds.zip
$ ln -s $PWD/eucarc ~/.eucarc
$ euca-bundle-image --image mycreds.zip
Invalid cert
$ egrep "(EUCA_KEY_DIR=|EC2_CERT=)" ~/.eucarc
EUCA_KEY_DIR=$(dirname $(readlink -f ${BASH_SOURCE}))
export EC2_CERT=${EUCA_KEY_DIR}/euca2-admin-1a4bb4d0-cert.pem
If bash is the syntax for the config file, then it makes most to use
bash to parse the config file, rather than limited python as above.
ProblemType: Bug
Architecture: amd64
Date: Tue Feb 23 12:50:57 2010
DistroRelease: Ubuntu 10.04
InstallationMedia: Error: [Errno 13] Permission denied: '/var/log/installer/media-info'
Package: euca2ools 1.2-0ubuntu1 [modified: usr/share/pyshared/euca2ools/__init__.py]
PackageArchitecture: all
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-14.20-server
SourcePackage: euca2ools
Uname: Linux 2.6.32-14-server x86_64
** Affects: euca2ools (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug lucid
--
euca2ools parsing of config file is severely limited
https://bugs.launchpad.net/bugs/526591
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to euca2ools in ubuntu.
More information about the Ubuntu-server-bugs
mailing list