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:
@@ -15,7 +15,8 @@
|
|||||||
|
|
||||||
# This script is designed to generate rss feeds for subscription from updates
|
# This script is designed to generate rss feeds for subscription from updates
|
||||||
# to various gerrit tracked projects. It is intended to be run periodically,
|
# 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 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
__author__ = "Chmouel Boudjnah <chmouel@chmouel.com>"
|
__author__ = "Chmouel Boudjnah <chmouel@chmouel.com>"
|
||||||
import json
|
import json
|
||||||
@@ -73,7 +74,11 @@ def parse_ini(inifile):
|
|||||||
OUTPUT_MODE)
|
OUTPUT_MODE)
|
||||||
return ret
|
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):
|
def debug(msg):
|
||||||
|
Reference in New Issue
Block a user