diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-06-27 10:32:04 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-06-27 10:41:53 -0400 |
commit | 7e43d4af98a12e5685f250bf2161fc7afebe02a1 (patch) | |
tree | c01973d3dcf075b394c7dec66a1a45894d8c9f4d /src/sbin | |
parent | 4261f7238e3b7eb169fcb0f672e7fdb86d722189 (diff) | |
download | bcfg2-7e43d4af98a12e5685f250bf2161fc7afebe02a1.tar.gz bcfg2-7e43d4af98a12e5685f250bf2161fc7afebe02a1.tar.bz2 bcfg2-7e43d4af98a12e5685f250bf2161fc7afebe02a1.zip |
Options: migrated reporting to new parser
Diffstat (limited to 'src/sbin')
-rwxr-xr-x | src/sbin/bcfg2-report-collector | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/sbin/bcfg2-report-collector b/src/sbin/bcfg2-report-collector index ae6d3b167..00e015100 100755 --- a/src/sbin/bcfg2-report-collector +++ b/src/sbin/bcfg2-report-collector @@ -11,20 +11,14 @@ from Bcfg2.Reporting.Collector import ReportingCollector, ReportingError def main(): + parser = Bcfg2.Options.get_parser(description="Collect Bcfg2 report data", + components=[ReportingCollector]) + parser.parse() logger = logging.getLogger('bcfg2-report-collector') - optinfo = dict(daemon=Bcfg2.Options.DAEMON, - repo=Bcfg2.Options.SERVER_REPOSITORY, - filemonitor=Bcfg2.Options.SERVER_FILEMONITOR, - web_configfile=Bcfg2.Options.WEB_CFILE) - optinfo.update(Bcfg2.Options.CLI_COMMON_OPTIONS) - optinfo.update(Bcfg2.Options.REPORTING_COMMON_OPTIONS) - setup = Bcfg2.Options.load_option_parser(optinfo) - setup.parse() # run collector try: - collector = ReportingCollector(setup) - collector.run() + ReportingCollector().run() except ReportingError: msg = sys.exc_info()[1] logger.error(msg) |