diff options
author | James Yang <jjyang@mcs.anl.gov> | 2008-07-11 22:33:06 +0000 |
---|---|---|
committer | James Yang <jjyang@mcs.anl.gov> | 2008-07-11 22:33:06 +0000 |
commit | 55fa20759f1719ee5b9da9b78d8d25f5b185df7f (patch) | |
tree | e4ae0b34af8762c31bfedb36a64d652efb8eef94 /src/lib/Server | |
parent | b81ceb877c480243400376bf8db214792a85beef (diff) | |
download | bcfg2-55fa20759f1719ee5b9da9b78d8d25f5b185df7f.tar.gz bcfg2-55fa20759f1719ee5b9da9b78d8d25f5b185df7f.tar.bz2 bcfg2-55fa20759f1719ee5b9da9b78d8d25f5b185df7f.zip |
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4776 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server')
-rw-r--r-- | src/lib/Server/Admin/Reports.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/lib/Server/Admin/Reports.py b/src/lib/Server/Admin/Reports.py index 7cf8b6a95..cafc61e2d 100644 --- a/src/lib/Server/Admin/Reports.py +++ b/src/lib/Server/Admin/Reports.py @@ -1,3 +1,22 @@ +#! /usr/bin/env python +'''Imports statistics.xml and clients.xml files in to database backend for new statistics engine''' +__revision__ = '$Revision: 4639 $' + +import os, sys +try: + import Bcfg2.Server.Reports.settings +except: + sys.stderr.write("Failed to load configuration settings. is /etc/bcfg2.conf readable?") + sys.exit(1) + +project_directory = os.path.dirname(Bcfg2.Server.Reports.settings.__file__) +project_name = os.path.basename(project_directory) +sys.path.append(os.path.join(project_directory, '..')) +project_module = __import__(project_name, '', '', ['']) +sys.path.pop() +# Set DJANGO_SETTINGS_MODULE appropriately. +os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % project_name + from Bcfg2.Server.Reports.reports.models import Client from getopt import getopt import datetime @@ -59,8 +78,6 @@ def print_fields(fields, cli, max_name): print display class Reports(Bcfg2.Server.Admin.Mode): - __shorthelp__ = 'bcfg2-admin reports' - __longhelp__ = __shorthelp__ + '\n\t Command line interface for the reporting system' def __call__(self, args): Bcfg2.Server.Admin.Mode.__call__(self, args) |