diff options
| author | Michael E Brown <michael_e_brown@dell.com> | 2007-10-24 13:01:41 -0500 |
|---|---|---|
| committer | Michael E Brown <michael_e_brown@dell.com> | 2007-10-24 13:01:41 -0500 |
| commit | 3619e93ae177e7dec332fac7484edeb0d0356e02 (patch) | |
| tree | 5c3a70b561c96672f341021c05a3206363c1296b /src | |
| parent | d54c89b18a849f6e881f566dba45f8aab9c42bfd (diff) | |
| download | mock-3619e93ae177e7dec332fac7484edeb0d0356e02.tar.gz mock-3619e93ae177e7dec332fac7484edeb0d0356e02.tar.xz mock-3619e93ae177e7dec332fac7484edeb0d0356e02.zip | |
better error message for when logging.ini doesnt exist. version bump.
Diffstat (limited to 'src')
| -rwxr-xr-x | src/mock.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mock.py b/src/mock.py index 7b36cdc..60b4789 100755 --- a/src/mock.py +++ b/src/mock.py @@ -30,7 +30,7 @@ import time from optparse import OptionParser # all of the variables below are substituted by the build system -__VERSION__="0.8.4" +__VERSION__="0.8.5" SYSCONFDIR="/usr/local/etc" PYTHONDIR="/usr/local/lib/python2.5/site-packages" PKGPYTHONDIR="/usr/local/lib/python2.5/site-packages/mock" @@ -237,7 +237,12 @@ def main(retParams): config_path = options.configdir # basic config for logging until config files are read - logging.config.fileConfig(os.path.join(config_path, config_opts["log_config_file"])) + log_ini = os.path.join(config_path, config_opts["log_config_file"]) + try: + logging.config.fileConfig(log_ini) + except (IOError, OSError), e: + log.error("Could not find required logging config file: %s" % log_ini) + sys.exit(50) # check args if len(args) < 1: |
