)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"5ab5918cff515425c03d30b474868b6d7034ec61","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix the return of ConfigOpts\u0027s __call__ method"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"According to the defination of ConfigOpts\u0027s __call__ method, it will"},{"line_number":10,"context_line":"return the args which cannot be parsed. But currently, the mothod has no"},{"line_number":11,"context_line":"return (None as default), that may break other callers."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Ifd659c8fbce5c06d2fd4d879377b990916a1089b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"baada198_3878d0c3","line":10,"updated":"2014-07-03 08:05:40.000000000","message":"s/mothod/method/","commit_id":"1401e4b026bb0d2712489d2203526e0df2c216d3"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"5a813d99e3efdcaedd56f82ed14487455e727b11","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix the return of ConfigOpts\u0027s __call__ method"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"According to the defination of ConfigOpts\u0027s __call__ method, it will"},{"line_number":10,"context_line":"return the args which cannot be parsed. But currently, the mothod has no"},{"line_number":11,"context_line":"return (None as default), that may break other callers."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Ifd659c8fbce5c06d2fd4d879377b990916a1089b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"baada198_8e8c3681","line":10,"in_reply_to":"baada198_3878d0c3","updated":"2014-07-03 08:11:09.000000000","message":"thanks, Done","commit_id":"1401e4b026bb0d2712489d2203526e0df2c216d3"}],"oslo/config/cfg.py":[{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"5ab5918cff515425c03d30b474868b6d7034ec61","unresolved":false,"context_lines":[{"line_number":1638,"context_line":"        :param default_config_files: config files to use by default"},{"line_number":1639,"context_line":"        :param validate_default_values: whether to validate the default values"},{"line_number":1640,"context_line":"        :returns: the list of arguments left over after parsing options"},{"line_number":1641,"context_line":"        :raises: SystemExit, ConfigFilesNotFoundError, ConfigFileParseError,"},{"line_number":1642,"context_line":"                 RequiredOptError, DuplicateOptError"},{"line_number":1643,"context_line":"        \"\"\""},{"line_number":1644,"context_line":"        self.clear()"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_0b5c9824","line":1641,"updated":"2014-07-03 08:05:40.000000000","message":"You should document your change here such as :returns: \u003cdescribe what do you return here\u003e","commit_id":"1401e4b026bb0d2712489d2203526e0df2c216d3"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"5a813d99e3efdcaedd56f82ed14487455e727b11","unresolved":false,"context_lines":[{"line_number":1638,"context_line":"        :param default_config_files: config files to use by default"},{"line_number":1639,"context_line":"        :param validate_default_values: whether to validate the default values"},{"line_number":1640,"context_line":"        :returns: the list of arguments left over after parsing options"},{"line_number":1641,"context_line":"        :raises: SystemExit, ConfigFilesNotFoundError, ConfigFileParseError,"},{"line_number":1642,"context_line":"                 RequiredOptError, DuplicateOptError"},{"line_number":1643,"context_line":"        \"\"\""},{"line_number":1644,"context_line":"        self.clear()"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_ae83ba54","line":1641,"in_reply_to":"baada198_0b5c9824","updated":"2014-07-03 08:11:09.000000000","message":"L1640 has provide the returns :)","commit_id":"1401e4b026bb0d2712489d2203526e0df2c216d3"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"7514a96e4d404d9478b0653d572f997928af83ea","unresolved":false,"context_lines":[{"line_number":1638,"context_line":"        :param default_config_files: config files to use by default"},{"line_number":1639,"context_line":"        :param validate_default_values: whether to validate the default values"},{"line_number":1640,"context_line":"        :returns: the list of arguments left over after parsing options"},{"line_number":1641,"context_line":"        :raises: SystemExit, ConfigFilesNotFoundError, ConfigFileParseError,"},{"line_number":1642,"context_line":"                 RequiredOptError, DuplicateOptError"},{"line_number":1643,"context_line":"        \"\"\""},{"line_number":1644,"context_line":"        self.clear()"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_646381dc","line":1641,"in_reply_to":"baada198_ae83ba54","updated":"2014-07-03 09:10:04.000000000","message":"OOps... Sorry \u003d)","commit_id":"1401e4b026bb0d2712489d2203526e0df2c216d3"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"5ab5918cff515425c03d30b474868b6d7034ec61","unresolved":false,"context_lines":[{"line_number":2243,"context_line":"        :return False if reload configure files failed or else return True"},{"line_number":2244,"context_line":"        \"\"\""},{"line_number":2245,"context_line":"        try:"},{"line_number":2246,"context_line":"            namespace, _ \u003d self._parse_config_files()"},{"line_number":2247,"context_line":"            if namespace._files_not_found:"},{"line_number":2248,"context_line":"                raise ConfigFilesNotFoundError(namespace._files_not_found)"},{"line_number":2249,"context_line":"            self._check_required_opts(namespace)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_2b031c43","line":2246,"updated":"2014-07-03 08:05:40.000000000","message":"That is bad idea to create unused variable and name it \"_\". First of all, unused vars is bad practice. Name \"_\" can cause a problems with common `gettextutils` module, because `gettextutils` provides the function of the same name. Just get first element of the tuple and ignore second if you don\u0027t need it.","commit_id":"1401e4b026bb0d2712489d2203526e0df2c216d3"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"5a813d99e3efdcaedd56f82ed14487455e727b11","unresolved":false,"context_lines":[{"line_number":2243,"context_line":"        :return False if reload configure files failed or else return True"},{"line_number":2244,"context_line":"        \"\"\""},{"line_number":2245,"context_line":"        try:"},{"line_number":2246,"context_line":"            namespace, _ \u003d self._parse_config_files()"},{"line_number":2247,"context_line":"            if namespace._files_not_found:"},{"line_number":2248,"context_line":"                raise ConfigFilesNotFoundError(namespace._files_not_found)"},{"line_number":2249,"context_line":"            self._check_required_opts(namespace)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_ce3b8e9a","line":2246,"in_reply_to":"baada198_2b031c43","updated":"2014-07-03 08:11:09.000000000","message":"cool, thanks for your suggestion:)","commit_id":"1401e4b026bb0d2712489d2203526e0df2c216d3"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"9c9471e22d9e2cfc510a3dc6c406ef6c8284e844","unresolved":false,"context_lines":[{"line_number":1513,"context_line":""},{"line_number":1514,"context_line":"    def parse_args(self, args\u003dNone, namespace\u003dNone):"},{"line_number":1515,"context_line":"        self.initialize_parser_arguments()"},{"line_number":1516,"context_line":"        return super(_CachedArgumentParser, self).parse_known_args(args,"},{"line_number":1517,"context_line":"                                                                   namespace)"},{"line_number":1518,"context_line":""},{"line_number":1519,"context_line":"    def print_help(self, file\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_f2b6e83d","line":1516,"updated":"2014-07-15 18:16:24.000000000","message":"Why did this change to parse_known_args()? The other version calls the parent class version of parse_args().","commit_id":"f1f0e294778fcf01167996615f83750064f701be"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"da26b3a4b60e0902eaef011e4dc4ea3754c704b3","unresolved":false,"context_lines":[{"line_number":1513,"context_line":""},{"line_number":1514,"context_line":"    def parse_args(self, args\u003dNone, namespace\u003dNone):"},{"line_number":1515,"context_line":"        self.initialize_parser_arguments()"},{"line_number":1516,"context_line":"        return super(_CachedArgumentParser, self).parse_known_args(args,"},{"line_number":1517,"context_line":"                                                                   namespace)"},{"line_number":1518,"context_line":""},{"line_number":1519,"context_line":"    def print_help(self, file\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_65c5f48c","line":1516,"in_reply_to":"baada198_1390b44d","updated":"2014-07-21 12:40:32.000000000","message":"The methods return different types and data structures. You kept the original method name and return unexpected data from it. If any other application expects for the type returned by `parse_known_args`, you should use `parse_known_args`, not `parse_args`.","commit_id":"f1f0e294778fcf01167996615f83750064f701be"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"9d6f3370e83ff995f2f548ef5e2a58ba6b3d8bb5","unresolved":false,"context_lines":[{"line_number":1513,"context_line":""},{"line_number":1514,"context_line":"    def parse_args(self, args\u003dNone, namespace\u003dNone):"},{"line_number":1515,"context_line":"        self.initialize_parser_arguments()"},{"line_number":1516,"context_line":"        return super(_CachedArgumentParser, self).parse_known_args(args,"},{"line_number":1517,"context_line":"                                                                   namespace)"},{"line_number":1518,"context_line":""},{"line_number":1519,"context_line":"    def print_help(self, file\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_ba525bdc","line":1516,"in_reply_to":"baada198_5be417e0","updated":"2014-07-23 01:56:54.000000000","message":"you are right, thanks for correct me! maybe I should redefine a new method like this:\n  def parse_known_args(self, args\u003dNone, namespace\u003dNone):\n      self.initialize_parser_arguments()\n      return super(_CachedArgumentParser, self).parse_known_args(args,namespace)\n\nhere return the argv as the arguments left over after parsing options, is because I have found there is a use case:\nhttps://github.com/openstack/ceilometer/blob/master/tools/show_data.py#L114\n\ncurrently, this py script is broken, one reason is the __call__() #L1608 method in this py file didn\u0027t return the extra args(return the None as default).\n\nAdditionally, I have found the the definition of of the __call__() method have described the return(please see #1639), but I don\u0027t know why it has no return actually.","commit_id":"f1f0e294778fcf01167996615f83750064f701be"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"66c64fb4169af1cc922e42bfa3cbb1503dd5ac34","unresolved":false,"context_lines":[{"line_number":1513,"context_line":""},{"line_number":1514,"context_line":"    def parse_args(self, args\u003dNone, namespace\u003dNone):"},{"line_number":1515,"context_line":"        self.initialize_parser_arguments()"},{"line_number":1516,"context_line":"        return super(_CachedArgumentParser, self).parse_known_args(args,"},{"line_number":1517,"context_line":"                                                                   namespace)"},{"line_number":1518,"context_line":""},{"line_number":1519,"context_line":"    def print_help(self, file\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_8262d7aa","line":1516,"in_reply_to":"baada198_65c5f48c","updated":"2014-07-22 02:22:00.000000000","message":"Sorry, I haven\u0027t got your idea clearly, \"the original method name\" you mean this parse_args() method? \"other application\" you mean other project of openstack?  I probably get you meaning. maybe I should propose a forward-compatible change, like:\n  def parse_args(self, args\u003dNone, namespace\u003dNone, ret_unknown_arg \u003d False):\n  self.initialize_parser_arguments()\n  if ret_unknown_arg:\n      return super(_CachedArgumentParser,   self).parse_known_args(args,namespace)\n  return super(_CachedArgumentParser, self).parse_args(args,   namespace)\n\nwill be Done in next ps\n\nthanks","commit_id":"f1f0e294778fcf01167996615f83750064f701be"},{"author":{"_account_id":7536,"name":"Ilya Pekelny","email":"ipekelny@mirantis.com","username":"I159"},"change_message_id":"24b0017476ca62b8b6dfa7079868e2d6868c927e","unresolved":false,"context_lines":[{"line_number":1513,"context_line":""},{"line_number":1514,"context_line":"    def parse_args(self, args\u003dNone, namespace\u003dNone):"},{"line_number":1515,"context_line":"        self.initialize_parser_arguments()"},{"line_number":1516,"context_line":"        return super(_CachedArgumentParser, self).parse_known_args(args,"},{"line_number":1517,"context_line":"                                                                   namespace)"},{"line_number":1518,"context_line":""},{"line_number":1519,"context_line":"    def print_help(self, file\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_5be417e0","line":1516,"in_reply_to":"baada198_8262d7aa","updated":"2014-07-22 08:45:17.000000000","message":"I don\u0027t know what is using it or what will use it. When you are overriding a method, you should use `super` to get the original method, the same one, not other methods, this is common OOP rule for Python. Otherwise, the function becomes unpredictable. https://docs.python.org/2/library/argparse.html#the-parse-args-method this is the documented Argparse method, you should return the same type as original one returns or rename it.","commit_id":"f1f0e294778fcf01167996615f83750064f701be"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"9e790ebeba45014e7fd730147281735ea8da625b","unresolved":false,"context_lines":[{"line_number":1513,"context_line":""},{"line_number":1514,"context_line":"    def parse_args(self, args\u003dNone, namespace\u003dNone):"},{"line_number":1515,"context_line":"        self.initialize_parser_arguments()"},{"line_number":1516,"context_line":"        return super(_CachedArgumentParser, self).parse_known_args(args,"},{"line_number":1517,"context_line":"                                                                   namespace)"},{"line_number":1518,"context_line":""},{"line_number":1519,"context_line":"    def print_help(self, file\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_1390b44d","line":1516,"in_reply_to":"baada198_f2b6e83d","updated":"2014-07-16 01:48:48.000000000","message":"the definition of parse_args() in Python27/Lib/argparse.py is:\n\n    def parse_args(self, args\u003dNone, namespace\u003dNone):\n        args, argv \u003d self.parse_known_args(args, namespace)\n        if argv:\n            msg \u003d _(\u0027unrecognized arguments: %s\u0027)\n            self.error(msg % \u0027 \u0027.join(argv))\n        return args\n\nthis parse_args() method just regards the argv as the \"unrecognized arguments\", but here we should return the argv as the arguments left over after parsing options.\n\nso here use the parse_known_args()","commit_id":"f1f0e294778fcf01167996615f83750064f701be"}],"tests/test_cfg.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"fe1f11d055e8c8af70cb643e4bfe7d74be062f71","unresolved":false,"context_lines":[{"line_number":2629,"context_line":""},{"line_number":2630,"context_line":"        self.useFixture(fixtures.MonkeyPatch(\u0027sys.stderr\u0027, moves.StringIO()))"},{"line_number":2631,"context_line":""},{"line_number":2632,"context_line":"        self.assertRaises(SystemExit, self.conf, [\u0027--foo\u0027])"},{"line_number":2633,"context_line":""},{"line_number":2634,"context_line":"        self.assertTrue(\u0027error\u0027 in sys.stderr.getvalue())"},{"line_number":2635,"context_line":"        self.assertTrue(\u0027--foo\u0027 in sys.stderr.getvalue())"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_acbdfb06","side":"PARENT","line":2632,"updated":"2014-08-12 19:42:40.000000000","message":"This still looks like behavior we want. If someone specifies an option name that isn\u0027t valid, we want to generate an error message.","commit_id":"a5ac14975e74968af44d7d5bc3764da92cb36dce"}]}
