)]}'
{"openstack_health/api.py":[{"author":{"_account_id":18001,"name":"Caio Carrara","email":"ccarrara@thoughtworks.com","username":"caiocarrara"},"change_message_id":"284d3c7f7afc6d03b22c6d2f481c788b07d23b32","unresolved":false,"context_lines":[{"line_number":37,"context_line":"def setup():"},{"line_number":38,"context_line":"    config \u003d ConfigParser.ConfigParser()"},{"line_number":39,"context_line":"    if len(sys.argv) \u003e 1:"},{"line_number":40,"context_line":"        config.read(sys.argv[1])"},{"line_number":41,"context_line":"    # If a config file isn\u0027t provided default to /etc/openstack-health.conf"},{"line_number":42,"context_line":"    else:"},{"line_number":43,"context_line":"        config.read(\u0027/etc/openstack-health.conf\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a2fa921_875d0217","line":40,"updated":"2015-10-08 20:54:17.000000000","message":"I am pretty sure that will not work always, for example if running api application under gunicorn. I do not think we\u0027ll be able to always set argv manually, as we can do with uwsgi (--pyargv).\n\nI think we don\u0027t need to pass the config file path as argument, specially if we\u0027re assuming to define a default location. If any config have to change, isn\u0027t just necessary to change the config in that file?","commit_id":"e530a7526b10173bd07b159f46596990d224946d"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"b1b8a6e4209ddb36bc1c43ab131f76778edbacce","unresolved":false,"context_lines":[{"line_number":37,"context_line":"def setup():"},{"line_number":38,"context_line":"    config \u003d ConfigParser.ConfigParser()"},{"line_number":39,"context_line":"    if len(sys.argv) \u003e 1:"},{"line_number":40,"context_line":"        config.read(sys.argv[1])"},{"line_number":41,"context_line":"    # If a config file isn\u0027t provided default to /etc/openstack-health.conf"},{"line_number":42,"context_line":"    else:"},{"line_number":43,"context_line":"        config.read(\u0027/etc/openstack-health.conf\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a2fa921_721bc673","line":40,"in_reply_to":"7a2fa921_875d0217","updated":"2015-10-08 21:18:32.000000000","message":"Oh, after playing with gunicorn I understand what you\u0027re saying now, sys.argv has the contents of the gunicorn command line, so if you invoke gunicorn standalone there will be args set but none of them are the config file, so things explode here. \n\nThat actually gives me a way to workaround this issue and make a general solution, I\u0027ll respin this to fix it","commit_id":"e530a7526b10173bd07b159f46596990d224946d"},{"author":{"_account_id":17995,"name":"Glauco Oliveira","email":"gvinici@thoughtworks.com","username":"glauco"},"change_message_id":"892962913e1ec8a2ddcf58602eccda20b5db5f64","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    global config"},{"line_number":40,"context_line":"    if not config:"},{"line_number":41,"context_line":"        config \u003d ConfigParser.ConfigParser()"},{"line_number":42,"context_line":"        config.read(\u0027/etc/openstack-health.conf\u0027)"},{"line_number":43,"context_line":"    global engine"},{"line_number":44,"context_line":"    engine \u003d create_engine(config.get(\u0027default\u0027, \u0027db_uri\u0027))"},{"line_number":45,"context_line":"    global Session"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a2fa921_c0e87db5","line":42,"updated":"2015-10-10 22:08:36.000000000","message":"Have tried using it with apache\u0027s mod_wsgi and it fails. We need to change it a bit to provide the absolute path to the configuration file. Otherwise, the first request will fail, as well the next ones that consume information from the database.\n\nI think this could be changed to be something such as:\n\nconfig_file \u003d os.path.abspath(\u0027./etc/openstack-health-api.conf\u0027)\n\nconfig.read(config_file)","commit_id":"228eeb436acc4fbcba4f5e4dddb2eaa8640ee049"},{"author":{"_account_id":17995,"name":"Glauco Oliveira","email":"gvinici@thoughtworks.com","username":"glauco"},"change_message_id":"e16a163bb3ffa293782cd9e8a769d3c3b2ab3e53","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    global config"},{"line_number":40,"context_line":"    if not config:"},{"line_number":41,"context_line":"        config \u003d ConfigParser.ConfigParser()"},{"line_number":42,"context_line":"        config.read(\u0027/etc/openstack-health.conf\u0027)"},{"line_number":43,"context_line":"    global engine"},{"line_number":44,"context_line":"    engine \u003d create_engine(config.get(\u0027default\u0027, \u0027db_uri\u0027))"},{"line_number":45,"context_line":"    global Session"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a2fa921_daf5accb","line":42,"in_reply_to":"7a2fa921_b3690428","updated":"2015-10-12 16:10:18.000000000","message":"Sorry, I thought you were referencing the file under etc/ directory. In that case, I have nothing else to add.","commit_id":"228eeb436acc4fbcba4f5e4dddb2eaa8640ee049"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"3575f54f6b364f83b061fc6905d5e64b9a4ae89a","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    global config"},{"line_number":40,"context_line":"    if not config:"},{"line_number":41,"context_line":"        config \u003d ConfigParser.ConfigParser()"},{"line_number":42,"context_line":"        config.read(\u0027/etc/openstack-health.conf\u0027)"},{"line_number":43,"context_line":"    global engine"},{"line_number":44,"context_line":"    engine \u003d create_engine(config.get(\u0027default\u0027, \u0027db_uri\u0027))"},{"line_number":45,"context_line":"    global Session"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a2fa921_b3690428","line":42,"in_reply_to":"7a2fa921_c0e87db5","updated":"2015-10-12 13:32:22.000000000","message":"Umm, this is an absolute path. You need to put the openstack-health.conf file in\n/etc. This is not looking for the local copy of config but a system version. Part of the puppet policy will be to have a template file for the api config file and we just need to make the path of that file: /etc/openstack-health.conf","commit_id":"228eeb436acc4fbcba4f5e4dddb2eaa8640ee049"}]}
