)]}'
{"nova/api/openstack/placement/wsgi.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c2b523bbbf03929c1a3385a0497cd6343a4d60cc","unresolved":false,"context_lines":[{"line_number":51,"context_line":"def init_application():"},{"line_number":52,"context_line":"    # initialize the config system"},{"line_number":53,"context_line":"    conffile \u003d _get_config_file()"},{"line_number":54,"context_line":"    config.parse_args(sys.argv, default_config_files\u003d[conffile])"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    # initialize the logging system"},{"line_number":57,"context_line":"    setup_logging(conf.CONF)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf091321_a5602534","line":54,"updated":"2017-06-08 21:11:02.000000000","message":"Who or what is setting the command line args?\n\nThis is a wsgi application that is supposed to be run by uwsgi, nginx, mod_wsgi, etc. where command line args are unusual.\n\nThe placement wsgi script _can_ run as a standalone but it is using the extremely-bad-idea wsgi simple server in the stdlib.\n\nThat should never be used in production.","commit_id":"710262ab04e8877d5eb39b2ad13a222ed7aba87b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2fca3b473e4377046d52721f7ba776d36ac6e205","unresolved":false,"context_lines":[{"line_number":51,"context_line":"def init_application():"},{"line_number":52,"context_line":"    # initialize the config system"},{"line_number":53,"context_line":"    conffile \u003d _get_config_file()"},{"line_number":54,"context_line":"    config.parse_args(sys.argv, default_config_files\u003d[conffile])"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    # initialize the logging system"},{"line_number":57,"context_line":"    setup_logging(conf.CONF)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f0e0f27_b1553020","line":54,"in_reply_to":"bf091321_06759895","updated":"2017-06-09 11:09:53.000000000","message":"I actually strong disagree with the approach which is not PEP-3333 compliant.\n\nIf you read that PEP, it\u0027s pretty clear that the configuration has to be passed thru environment options and not thru CLI even if uwsgi allows that.\n\nhttps://www.python.org/dev/peps/pep-3333/#application-configuration\n\nJust to make it clear, we specifically provided the environment name OS_PLACEMENT_CONFIG_DIR for that purpose. \n\n\nAlso, keep in mind that application configuration has to be request-based. Allowing CLI parameters to be passed would defeat that logic and would make the use of that application script dependent on how you instantiate the WSGI server (as a separate process or not).\n\nI suggest also reading http://modwsgi.readthedocs.io/en/develop/user-guides/configuration-guidelines.html#application-configuration for mod_wsgi (which is unrelated to how to load wsgi, either embedded or in deamon mode)\n\nFor uwsgi, the simpliest is to add a env option :\n\nhttp://uwsgi-docs.readthedocs.io/en/latest/Options.html#env\n\nsomething like :\n\n [uwsgi]\n wsgi-file \u003d /snap/nova/x1/bin/nova-placement-api\n env \u003d OS_PLACEMENT_CONFIG_DIR\u003d/snap/nova/x1/etc/nova/\n \u003csnip/\u003e","commit_id":"710262ab04e8877d5eb39b2ad13a222ed7aba87b"},{"author":{"_account_id":11805,"name":"Corey Bryant","email":"corey.bryant@canonical.com","username":"coreycb"},"change_message_id":"1ce354f06331036133249375d5e9095a4a947039","unresolved":false,"context_lines":[{"line_number":51,"context_line":"def init_application():"},{"line_number":52,"context_line":"    # initialize the config system"},{"line_number":53,"context_line":"    conffile \u003d _get_config_file()"},{"line_number":54,"context_line":"    config.parse_args(sys.argv, default_config_files\u003d[conffile])"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    # initialize the logging system"},{"line_number":57,"context_line":"    setup_logging(conf.CONF)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf091321_06759895","line":54,"in_reply_to":"bf091321_a5602534","updated":"2017-06-08 21:42:19.000000000","message":"In our case it\u0027s used via pyargv in uwsgi config. http://paste.ubuntu.com/24810681/","commit_id":"710262ab04e8877d5eb39b2ad13a222ed7aba87b"}]}
