Changed parsing for config file to accept configurable location of openstackwatch.ini file.

Change-Id: I93771b0abeff2908a586132c58c20fa21a62855b
Reviewed-on: https://review.openstack.org/24225
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Elizabeth Krumbach <lyz@princessleia.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Anita Kuno
2013-03-12 14:14:38 -04:00
committed by Jenkins
parent 863a671463
commit 96a159da64

View File

@@ -15,7 +15,8 @@
# This script is designed to generate rss feeds for subscription from updates
# to various gerrit tracked projects. It is intended to be run periodically,
# for example hourly via cron.
# for example hourly via cron. It takes an optional argument to specify the
# path to a configuration file.
# -*- encoding: utf-8 -*-
__author__ = "Chmouel Boudjnah <chmouel@chmouel.com>"
import json
@@ -73,7 +74,11 @@ def parse_ini(inifile):
OUTPUT_MODE)
return ret
CONFIG = parse_ini(os.path.join(curdir, '..', 'config', 'openstackwatch.ini'))
try:
conffile = sys.argv[1]
except IndexError:
conffile = os.path.join(curdir, '..', 'config', 'openstackwatch.ini')
CONFIG = parse_ini(conffile)
def debug(msg):