diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2011-03-17 08:57:08 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-03-17 08:57:08 -0500 |
commit | a6df9ca354ed4f7e1e569a0c858dbc3b6e68faa1 (patch) | |
tree | 426dddbcee9504ce8abf25eb8eccdee97dc51e63 | |
parent | 0984e097c2f7d973320fa14fcfab36d3122cfaf0 (diff) | |
download | bcfg2-a6df9ca354ed4f7e1e569a0c858dbc3b6e68faa1.tar.gz bcfg2-a6df9ca354ed4f7e1e569a0c858dbc3b6e68faa1.tar.bz2 bcfg2-a6df9ca354ed4f7e1e569a0c858dbc3b6e68faa1.zip |
bcfg2-reports: Fail gracefully when missing statistics
This fix is to address the traceback at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608613. We need to
inform the user about the [statistics] section in bcfg2.conf so that
they can go and find the necessary information needed to set up reports.
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
-rwxr-xr-x | src/sbin/bcfg2-reports | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sbin/bcfg2-reports b/src/sbin/bcfg2-reports index d83e45e7c..559e9fb43 100755 --- a/src/sbin/bcfg2-reports +++ b/src/sbin/bcfg2-reports @@ -5,7 +5,13 @@ __revision__ = '$Revision$' import os import sys -import Bcfg2.Server.Reports.settings +try: + import Bcfg2.Server.Reports.settings +except ConfigParser.NoSectionError: + print("Your bcfg2.conf is currently missing the statistics section which " + "is necessary for the reporting interface. Please see bcfg2.conf(5) " + "for more details.") + sys.exit(1) project_directory = os.path.dirname(Bcfg2.Server.Reports.settings.__file__) project_name = os.path.basename(project_directory) |