)]}'
{"oslo/config/cfg.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"5c68ad22f8607b7438bad0087c13f5e28d0d34c1","unresolved":false,"context_lines":[{"line_number":1848,"context_line":"        namespace \u003d _Namespace()"},{"line_number":1849,"context_line":""},{"line_number":1850,"context_line":"        for arg in args:"},{"line_number":1851,"context_line":"            if (arg \u003d\u003d \u0027--config-file\u0027 or arg.startswith(\u0027--config-file\u0027)):"},{"line_number":1852,"context_line":"                break"},{"line_number":1853,"context_line":"        else:"},{"line_number":1854,"context_line":"            for config_file in self.default_config_files:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2F%2Blo%3D","line":1851,"updated":"2013-05-17 14:11:23.000000000","message":"I think startswith is enough to verify both cases","commit_id":"f5dc0b46ee3dbeab151469e2dd69529ec970df37"},{"author":{"_account_id":1247,"name":"Mark McLoughlin","email":"markmc@redhat.com","username":"markmc"},"change_message_id":"cb9389e5a9da90d660818cb762a88c31428159a9","unresolved":false,"context_lines":[{"line_number":1848,"context_line":"        namespace \u003d _Namespace()"},{"line_number":1849,"context_line":""},{"line_number":1850,"context_line":"        for arg in args:"},{"line_number":1851,"context_line":"            if (arg \u003d\u003d \u0027--config-file\u0027 or arg.startswith(\u0027--config-file\u0027)):"},{"line_number":1852,"context_line":"                break"},{"line_number":1853,"context_line":"        else:"},{"line_number":1854,"context_line":"            for config_file in self.default_config_files:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2F5Gw%3D","line":1851,"in_reply_to":"AAAAPH%2F%2F%2Blo%3D","updated":"2013-05-20 21:15:58.000000000","message":"Good catch, but I meant it to be:\n\n  if (arg \u003d\u003d \u0027--config-file\u0027 or arg.startswith(\u0027--config-file\u003d\u0027)):\n\ni.e. I want to catch these cases:\n\n  --config-file foo.conf\n  --config-file\u003dfoo.conf\n\nbut not:\n\n  --config-file-extra-app-specific-option foo.conf\n\nI\u0027ll add those to the default config files tests","commit_id":"f5dc0b46ee3dbeab151469e2dd69529ec970df37"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"901f2b5ebb3a84541243931331425d8b471c8eea","unresolved":false,"context_lines":[{"line_number":1174,"context_line":"        namespace._add_parsed_config_file(sections)"},{"line_number":1175,"context_line":""},{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"class _Namespace(argparse.Namespace):"},{"line_number":1178,"context_line":""},{"line_number":1179,"context_line":"    \"\"\"An argparse namespace which also stores config file values."},{"line_number":1180,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fzpg%3D","line":1177,"updated":"2013-05-22 16:22:39.000000000","message":"The ChainMap is another way to build something like this. One example in the Python 3 library docs combines command line options, environment variables, and defaults.\n\nhttp://docs.python.org/dev/library/collections#collections.ChainMap\n\nI don\u0027t necessarily think you need to reimplement this Namespace class, but I thought it might be of interest.","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"4fcb13d2b929551ba3ea0eaeb55ec32f8e17dc5f","unresolved":false,"context_lines":[{"line_number":1174,"context_line":"        namespace._add_parsed_config_file(sections)"},{"line_number":1175,"context_line":""},{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"class _Namespace(argparse.Namespace):"},{"line_number":1178,"context_line":""},{"line_number":1179,"context_line":"    \"\"\"An argparse namespace which also stores config file values."},{"line_number":1180,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FjEA%3D","line":1177,"in_reply_to":"AAAAPH%2F%2FwKY%3D","updated":"2013-05-30 19:42:46.000000000","message":"The ChainMap was just an example of a data structure that does the stacking. We could build something else that supports multiple values, but I didn\u0027t think about the type conversion issue.","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":1247,"name":"Mark McLoughlin","email":"markmc@redhat.com","username":"markmc"},"change_message_id":"899dca25b3df667be0d134e2f23eff09c7d8d940","unresolved":false,"context_lines":[{"line_number":1174,"context_line":"        namespace._add_parsed_config_file(sections)"},{"line_number":1175,"context_line":""},{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"class _Namespace(argparse.Namespace):"},{"line_number":1178,"context_line":""},{"line_number":1179,"context_line":"    \"\"\"An argparse namespace which also stores config file values."},{"line_number":1180,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FwKY%3D","line":1177,"in_reply_to":"AAAAPH%2F%2Fzpg%3D","updated":"2013-05-23 20:42:15.000000000","message":"If we did do this with ChainMap, it wouldn\u0027t be fundamentally different from how we deal with values specified in config files - e.g. _Namespace._parsed is analogous to ChainMap.maps\n\nBut ChainMap can\u0027t handle multi values ...\n\nAlso, we need to treat values on the command line and values found in the config files differently, basically because of the way we do type conversions\n\nWe can have argparse do the type conversions of everything found at CLI parsing time, but we must delay the type conversion of non-cli opts until lookup time because we allow opt schemas to be registered after the command line was parsed\n\nSo, the attributes on the Namespace have already been properly type converted whereas the values in the Namespace._parsed chain of maps have not yet been converted","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"901f2b5ebb3a84541243931331425d8b471c8eea","unresolved":false,"context_lines":[{"line_number":1282,"context_line":"                           help\u003d(\u0027Path to a config file to use. Multiple \u0027"},{"line_number":1283,"context_line":"                                 \u0027config files can be specified, with values \u0027"},{"line_number":1284,"context_line":"                                 \u0027in later files taking precedence. The \u0027"},{"line_number":1285,"context_line":"                                 \u0027default files used are: %s\u0027 %"},{"line_number":1286,"context_line":"                                 (default_config_files, ))),"},{"line_number":1287,"context_line":"            _ConfigDirOpt(\u0027config-dir\u0027,"},{"line_number":1288,"context_line":"                          metavar\u003d\u0027DIR\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FzpM%3D","line":1285,"updated":"2013-05-22 16:22:39.000000000","message":"If you put %(default)s in the help string, argparse will insert the values for you automatically. http://docs.python.org/2/library/argparse.html#help","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":1247,"name":"Mark McLoughlin","email":"markmc@redhat.com","username":"markmc"},"change_message_id":"899dca25b3df667be0d134e2f23eff09c7d8d940","unresolved":false,"context_lines":[{"line_number":1282,"context_line":"                           help\u003d(\u0027Path to a config file to use. Multiple \u0027"},{"line_number":1283,"context_line":"                                 \u0027config files can be specified, with values \u0027"},{"line_number":1284,"context_line":"                                 \u0027in later files taking precedence. The \u0027"},{"line_number":1285,"context_line":"                                 \u0027default files used are: %s\u0027 %"},{"line_number":1286,"context_line":"                                 (default_config_files, ))),"},{"line_number":1287,"context_line":"            _ConfigDirOpt(\u0027config-dir\u0027,"},{"line_number":1288,"context_line":"                          metavar\u003d\u0027DIR\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FwIw%3D","line":1285,"in_reply_to":"AAAAPH%2F%2FzpM%3D","updated":"2013-05-23 20:42:15.000000000","message":"Thanks, see I818101a222a64c12617c89d1f498a0a7c50b2184","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"96cadec8344445c2edd4b062ac22c0b7b5d28c9a","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                                 (default_config_files, ))),"},{"line_number":1287,"context_line":"            _ConfigDirOpt(\u0027config-dir\u0027,"},{"line_number":1288,"context_line":"                          metavar\u003d\u0027DIR\u0027,"},{"line_number":1289,"context_line":"                          help\u003d\u0027Path to a config deirectory to pull *.conf \u0027"},{"line_number":1290,"context_line":"                               \u0027files from. This file set is sorted, so as to \u0027"},{"line_number":1291,"context_line":"                               \u0027provide a predictable parse order if \u0027"},{"line_number":1292,"context_line":"                               \u0027individual options are over-ridden. The set \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FvCo%3D","line":1289,"updated":"2013-05-24 06:09:49.000000000","message":"\"directory\"","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":1247,"name":"Mark McLoughlin","email":"markmc@redhat.com","username":"markmc"},"change_message_id":"d28b4891c72d3d02b0ca372828467bc44efd60bf","unresolved":false,"context_lines":[{"line_number":1286,"context_line":"                                 (default_config_files, ))),"},{"line_number":1287,"context_line":"            _ConfigDirOpt(\u0027config-dir\u0027,"},{"line_number":1288,"context_line":"                          metavar\u003d\u0027DIR\u0027,"},{"line_number":1289,"context_line":"                          help\u003d\u0027Path to a config deirectory to pull *.conf \u0027"},{"line_number":1290,"context_line":"                               \u0027files from. This file set is sorted, so as to \u0027"},{"line_number":1291,"context_line":"                               \u0027provide a predictable parse order if \u0027"},{"line_number":1292,"context_line":"                               \u0027individual options are over-ridden. The set \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FuWY%3D","line":1289,"in_reply_to":"AAAAPH%2F%2FvCo%3D","updated":"2013-05-24 12:49:18.000000000","message":"Done","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"901f2b5ebb3a84541243931331425d8b471c8eea","unresolved":false,"context_lines":[{"line_number":1847,"context_line":""},{"line_number":1848,"context_line":"        namespace \u003d _Namespace()"},{"line_number":1849,"context_line":""},{"line_number":1850,"context_line":"        for arg in args:"},{"line_number":1851,"context_line":"            if (arg \u003d\u003d \u0027--config-file\u0027 or arg.startswith(\u0027--config-file\u003d\u0027)):"},{"line_number":1852,"context_line":"                break"},{"line_number":1853,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fznc%3D","line":1850,"updated":"2013-05-22 16:22:39.000000000","message":"This feels a little weird, because it\u0027s parsing the options twice. What do you think about calling self._oparser.parse_args() and then checking to see if any config files were specified afterwards. If not, then parse the default configuration files and insert their settings at the bottom of the namespace.","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"96cadec8344445c2edd4b062ac22c0b7b5d28c9a","unresolved":false,"context_lines":[{"line_number":1847,"context_line":""},{"line_number":1848,"context_line":"        namespace \u003d _Namespace()"},{"line_number":1849,"context_line":""},{"line_number":1850,"context_line":"        for arg in args:"},{"line_number":1851,"context_line":"            if (arg \u003d\u003d \u0027--config-file\u0027 or arg.startswith(\u0027--config-file\u003d\u0027)):"},{"line_number":1852,"context_line":"                break"},{"line_number":1853,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FvCQ%3D","line":1850,"in_reply_to":"AAAAPH%2F%2FwGk%3D","updated":"2013-05-24 06:09:49.000000000","message":"agree.","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"4fcb13d2b929551ba3ea0eaeb55ec32f8e17dc5f","unresolved":false,"context_lines":[{"line_number":1847,"context_line":""},{"line_number":1848,"context_line":"        namespace \u003d _Namespace()"},{"line_number":1849,"context_line":""},{"line_number":1850,"context_line":"        for arg in args:"},{"line_number":1851,"context_line":"            if (arg \u003d\u003d \u0027--config-file\u0027 or arg.startswith(\u0027--config-file\u003d\u0027)):"},{"line_number":1852,"context_line":"                break"},{"line_number":1853,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FjDc%3D","line":1850,"in_reply_to":"AAAAPH%2F%2FwHk%3D","updated":"2013-05-30 19:42:46.000000000","message":"I\u0027m not sure I understand the order issue you describe, but if the stack approach won\u0027t work we could just set a flag that says a command line option set the configuration files so we know whether or not we\u0027re using the default here. But I agree, it\u0027s not that big of a deal, it just felt odd.","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":1247,"name":"Mark McLoughlin","email":"markmc@redhat.com","username":"markmc"},"change_message_id":"f1072da2777b6a4f0327f7196e31b3b1cb6208a8","unresolved":false,"context_lines":[{"line_number":1847,"context_line":""},{"line_number":1848,"context_line":"        namespace \u003d _Namespace()"},{"line_number":1849,"context_line":""},{"line_number":1850,"context_line":"        for arg in args:"},{"line_number":1851,"context_line":"            if (arg \u003d\u003d \u0027--config-file\u0027 or arg.startswith(\u0027--config-file\u003d\u0027)):"},{"line_number":1852,"context_line":"                break"},{"line_number":1853,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FwGk%3D","line":1850,"in_reply_to":"AAAAPH%2F%2FwHk%3D","updated":"2013-05-23 20:51:06.000000000","message":"Oh, I meant to say too ... scanning the command line for --config-file options doesn\u0027t seem too nasty too me ... it\u0027s not a full parsing of the command line or anything","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":1247,"name":"Mark McLoughlin","email":"markmc@redhat.com","username":"markmc"},"change_message_id":"899dca25b3df667be0d134e2f23eff09c7d8d940","unresolved":false,"context_lines":[{"line_number":1847,"context_line":""},{"line_number":1848,"context_line":"        namespace \u003d _Namespace()"},{"line_number":1849,"context_line":""},{"line_number":1850,"context_line":"        for arg in args:"},{"line_number":1851,"context_line":"            if (arg \u003d\u003d \u0027--config-file\u0027 or arg.startswith(\u0027--config-file\u003d\u0027)):"},{"line_number":1852,"context_line":"                break"},{"line_number":1853,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FwHk%3D","line":1850,"in_reply_to":"AAAAPH%2F%2Fznc%3D","updated":"2013-05-23 20:42:15.000000000","message":"I think it was mainly the logic in the next patch I was preparing for here\n\nI want to use the same logic for default config files for the type converting of cli options in config files as we parse the command line\n\nIf we delayed the parsing of default config files to the end, we\u0027d have to have special logic whereby the cli-opt values parsed from config files shouldn\u0027t override the already parsed options if we\u0027re dealing with a default config file\n\nBasically, for cli opts we end up not having a stack of the values we\u0027ve seen - i.e. we\u0027ve no stack to \"insert their settings at the bottom\" for cli options - because we override any previous values on the namespace as we parse","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"96cadec8344445c2edd4b062ac22c0b7b5d28c9a","unresolved":false,"context_lines":[{"line_number":1848,"context_line":"        namespace \u003d _Namespace()"},{"line_number":1849,"context_line":""},{"line_number":1850,"context_line":"        for arg in args:"},{"line_number":1851,"context_line":"            if (arg \u003d\u003d \u0027--config-file\u0027 or arg.startswith(\u0027--config-file\u003d\u0027)):"},{"line_number":1852,"context_line":"                break"},{"line_number":1853,"context_line":"        else:"},{"line_number":1854,"context_line":"            for config_file in self.default_config_files:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FvCU%3D","line":1851,"updated":"2013-05-24 06:09:49.000000000","message":"minor thing but we may not need the outer parenthesis","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"},{"author":{"_account_id":1247,"name":"Mark McLoughlin","email":"markmc@redhat.com","username":"markmc"},"change_message_id":"d28b4891c72d3d02b0ca372828467bc44efd60bf","unresolved":false,"context_lines":[{"line_number":1848,"context_line":"        namespace \u003d _Namespace()"},{"line_number":1849,"context_line":""},{"line_number":1850,"context_line":"        for arg in args:"},{"line_number":1851,"context_line":"            if (arg \u003d\u003d \u0027--config-file\u0027 or arg.startswith(\u0027--config-file\u003d\u0027)):"},{"line_number":1852,"context_line":"                break"},{"line_number":1853,"context_line":"        else:"},{"line_number":1854,"context_line":"            for config_file in self.default_config_files:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FuWk%3D","line":1851,"in_reply_to":"AAAAPH%2F%2FvCU%3D","updated":"2013-05-24 12:49:18.000000000","message":"Done","commit_id":"41d5ed705be0bd798c4e947059c565dda65b6dad"}]}
