)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"b60d91a2cb3ffd9cd3b17192527917b124b30e6f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"glusterManager instantiation regexp validation"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"GlusterManager can instantiaed in two ways: - with an address string"},{"line_number":10,"context_line":"like \"johndoe@example.com:/vol/dir\" - with a component dict like"},{"line_number":11,"context_line":"{\u0027user\u0027: \u0027johndoe\u0027, \u0027host\u0027: \u0027example.com\u0027, \u0027volume$"},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9aed3d3a_d38498d5","line":9,"updated":"2016-02-27 01:31:33.000000000","message":"should be: instantiated","commit_id":"082f344cc789ba407463b1ba30030ce1f00bc288"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"b60d91a2cb3ffd9cd3b17192527917b124b30e6f","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"GlusterManager can instantiaed in two ways: - with an address string"},{"line_number":10,"context_line":"like \"johndoe@example.com:/vol/dir\" - with a component dict like"},{"line_number":11,"context_line":"{\u0027user\u0027: \u0027johndoe\u0027, \u0027host\u0027: \u0027example.com\u0027, \u0027volume$"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"If the instance is created with an address string, it will be parsed"},{"line_number":14,"context_line":"using regexp which facilitates the validation of the certain component"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9aed3d3a_73cb0c1f","line":11,"updated":"2016-02-27 01:31:33.000000000","message":"There seems to be a collapsed unordered list here. Please either reword the sentence without having a list in it, or format that list properly.\n\nAlso the sample component dict seems to have got truncated somehow.","commit_id":"082f344cc789ba407463b1ba30030ce1f00bc288"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"b60d91a2cb3ffd9cd3b17192527917b124b30e6f","unresolved":false,"context_lines":[{"line_number":14,"context_line":"using regexp which facilitates the validation of the certain component"},{"line_number":15,"context_line":"values."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Made changes such that if the Gluster Manager is created using a"},{"line_number":18,"context_line":"component dict, then change the format into the address string and allow"},{"line_number":19,"context_line":"it to be parsed."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9aed3d3a_93efb086","line":17,"updated":"2016-02-27 01:31:33.000000000","message":"should be: either \"GlusterManager instance is created\" or \"GlusterManager is instantiated\"","commit_id":"082f344cc789ba407463b1ba30030ce1f00bc288"},{"author":{"_account_id":13998,"name":"Daniel Gonzalez Nothnagel","email":"daniel.gonzalez.nothnagel@sap.com","username":"dgonzalez"},"change_message_id":"7d3a8a94af5804541513fc0a75ce30011e53bd9f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"glusterManager instantiation regexp validation"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"GlusterManager can instantiated in two ways:"},{"line_number":10,"context_line":"- with an address string like \"johndoe@example.com:/vol/dir\""},{"line_number":11,"context_line":"- with a component dict like"},{"line_number":12,"context_line":"   {\u0027user\u0027: \u0027johndoe\u0027,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"7af24918_feb46183","line":9,"range":{"start_line":9,"start_character":15,"end_line":9,"end_character":31},"updated":"2016-03-04 17:31:51.000000000","message":"can be instantiated","commit_id":"f9044947285eb6b07b12c939f0dedcbf9aaa6b9d"}],"manila/share/drivers/glusterfs/common.py":[{"author":{"_account_id":13998,"name":"Daniel Gonzalez Nothnagel","email":"daniel.gonzalez.nothnagel@sap.com","username":"dgonzalez"},"change_message_id":"442851bb45bae8666528c412ac693cee9226916c","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        if isinstance(address, dict):"},{"line_number":104,"context_line":"            tmp_addr \u003d address"},{"line_number":105,"context_line":"            address \u003d tmp_addr[\u0027user\u0027] + \u0027@\u0027 + tmp_addr[\u0027host\u0027] + \u0027:/\u0027 \\"},{"line_number":106,"context_line":"                                       + tmp_addr[\u0027volume\u0027] + \u0027/\u0027 \\"},{"line_number":107,"context_line":"                                       + tmp_addr[\u0027path\u0027]"},{"line_number":108,"context_line":"        self.components \u003d self.parse(address)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_a825c35c","line":105,"updated":"2016-02-23 20:26:07.000000000","message":"I think there should be some kind of check to verify that tmp_addr actually contains these keys, to prevent KeyErrors. (Or use get() to retrieve the values from tmp_addr)","commit_id":"e9910e63e0e53283cd8c5d4ade02186881bebdec"},{"author":{"_account_id":13998,"name":"Daniel Gonzalez Nothnagel","email":"daniel.gonzalez.nothnagel@sap.com","username":"dgonzalez"},"change_message_id":"08acb7a155f478ced023648798156b25825c4de7","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            tmp_addr \u003d address"},{"line_number":105,"context_line":"            try:"},{"line_number":106,"context_line":"                address \u003d \\"},{"line_number":107,"context_line":"                    tmp_addr.get(\u0027user\u0027) + \\"},{"line_number":108,"context_line":"                    \u0027@\u0027 + tmp_addr.get(\u0027host\u0027) + \\"},{"line_number":109,"context_line":"                    \u0027:/\u0027 + tmp_addr.get(\u0027volume\u0027) + \\"},{"line_number":110,"context_line":"                    \u0027/\u0027 + tmp_addr.get(\u0027path\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bae84128_d1e54e09","line":107,"updated":"2016-02-23 21:36:55.000000000","message":"Ok, i guess the code should work like this.\nStill, i think the \"except Exception\" isn\u0027t the most elegant solution here.\n\nIn my opinion there are two ways to do this in a better way:\n\n1. Use get(key, \"\") with an empty string as second parameter, wich will prevent that the method returns a None value (see https://docs.python.org/2/library/stdtypes.html#dict.get). Then you can remove the \"except Exception\" stuff and let self.parse(address) figure out if the address is valid or not.\n\n2. Change the get() methods back to tmp_addr[key], and instead of doing an \"except Exception\" just do \"except KeyError\", to ensure that you only catch errors regarding the gluster address.","commit_id":"78cedbf191cdbcd5372d79fd9199162926e07fad"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"9b72071e84b11ecc2a202a966a33ccffab0cf827","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                    tmp_addr.get(\u0027user\u0027) + \\"},{"line_number":108,"context_line":"                    \u0027@\u0027 + tmp_addr.get(\u0027host\u0027) + \\"},{"line_number":109,"context_line":"                    \u0027:/\u0027 + tmp_addr.get(\u0027volume\u0027) + \\"},{"line_number":110,"context_line":"                    \u0027/\u0027 + tmp_addr.get(\u0027path\u0027)"},{"line_number":111,"context_line":"            except Exception:"},{"line_number":112,"context_line":"                raise exception.GlusterfsException("},{"line_number":113,"context_line":"                    _(\u0027Invalid gluster address %s.\u0027) % address)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bae84128_c6054415","line":110,"updated":"2016-02-25 00:04:21.000000000","message":"Alas, it\u0027 a bit more complex than you\u0027re approaching it, because not all the components are required. Actually, only \u0027host\u0027 is required (and there is one extra condition: \u0027path\u0027 supposes having \u0027volume\u0027, but checking that can be left to the regex match).\n\nProbably this would be a quick a way of assembling it:\n\nuser \u003d address.pop(\u0027user\u0027, None)\ncomponents \u003d {\u0027host\u0027 :\u0027\u0027, \u0027volume\u0027: \u0027\u0027, \u0027path\u0027: \u0027\u0027}\ncomponents.update(address)\naddress \u003d \"%(host)s:/%(volume)s/%(path)s\" % components\nif user:\n    address \u003d \u0027@\u0027.join([str(user), address])\n\nIf we are willing to accept non-string-valued address dicts with the convention that values are mangled through str(), then this produces an address string that\u0027s good enough for to be passed on to the regexp based parsing/validation routine and it\u0027s not even needed to be guarded by try/except.","commit_id":"78cedbf191cdbcd5372d79fd9199162926e07fad"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"61316999a72eb9219225da9ae6c4a7fb1f094594","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        if isinstance(address, dict):"},{"line_number":104,"context_line":"            tmp_addr \u003d address"},{"line_number":105,"context_line":"            try:"},{"line_number":106,"context_line":"                address \u003d \\"},{"line_number":107,"context_line":"                    tmp_addr.get(\u0027user\u0027) + \\"},{"line_number":108,"context_line":"                    \u0027@\u0027 + tmp_addr.get(\u0027host\u0027) + \\"},{"line_number":109,"context_line":"                    \u0027:/\u0027 + tmp_addr.get(\u0027volume\u0027) + \\"},{"line_number":110,"context_line":"                    \u0027/\u0027 + tmp_addr.get(\u0027path\u0027)"},{"line_number":111,"context_line":"            except Exception:"},{"line_number":112,"context_line":"                raise exception.GlusterfsException("},{"line_number":113,"context_line":"                    _(\u0027Invalid gluster address %s.\u0027) % address)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bae84128_d240a909","line":110,"range":{"start_line":106,"start_character":16,"end_line":110,"end_character":46},"updated":"2016-02-23 23:55:09.000000000","message":"Please avoid \u0027\\\u0027 for breaking long lines, use parenthesis instead.. http://docs.openstack.org/developer/hacking/#general","commit_id":"78cedbf191cdbcd5372d79fd9199162926e07fad"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"61316999a72eb9219225da9ae6c4a7fb1f094594","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                    \u0027@\u0027 + tmp_addr.get(\u0027host\u0027) + \\"},{"line_number":109,"context_line":"                    \u0027:/\u0027 + tmp_addr.get(\u0027volume\u0027) + \\"},{"line_number":110,"context_line":"                    \u0027/\u0027 + tmp_addr.get(\u0027path\u0027)"},{"line_number":111,"context_line":"            except Exception:"},{"line_number":112,"context_line":"                raise exception.GlusterfsException("},{"line_number":113,"context_line":"                    _(\u0027Invalid gluster address %s.\u0027) % address)"},{"line_number":114,"context_line":"        self.components \u003d self.parse(address)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bae84128_326755b8","line":111,"range":{"start_line":111,"start_character":12,"end_line":111,"end_character":29},"updated":"2016-02-23 23:55:09.000000000","message":"You\u0027re expecting TypeError. that\u0027s the only exception you will receive as you\u0027re using dict.get(), so handle that","commit_id":"78cedbf191cdbcd5372d79fd9199162926e07fad"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"0d37b975dd415b80bde4cf436cfc445b64e05f17","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def parse(cls, address):"},{"line_number":91,"context_line":"        \"\"\"Format and parse address string into component dict.\"\"\""},{"line_number":92,"context_line":"        if address.endswith(\u0027/\u0027):"},{"line_number":93,"context_line":"            address \u003d address[:-1]"},{"line_number":94,"context_line":"        m \u003d cls.scheme.search(address)"},{"line_number":95,"context_line":"        if not m:"},{"line_number":96,"context_line":"            raise exception.GlusterfsException("}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_9ae00698","line":93,"updated":"2016-02-29 23:18:36.000000000","message":"Why is it important to strip the trailing slash?\n\nI mean, why to do any kind of path normalization? And once if we do, why pick trailing-slash-stripping, why not do duplicate-slash-squasing, or single/double-dot-path-component-elimination...?","commit_id":"13253c70d9e707afc36e960f30b34f452c37b4d1"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"b2657d3dc8416e566c9d78a3c9900f036fce0f7e","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def parse(cls, address):"},{"line_number":91,"context_line":"        \"\"\"Format and parse address string into component dict.\"\"\""},{"line_number":92,"context_line":"        if address.endswith(\u0027/\u0027):"},{"line_number":93,"context_line":"            address \u003d address[:-1]"},{"line_number":94,"context_line":"        m \u003d cls.scheme.search(address)"},{"line_number":95,"context_line":"        if not m:"},{"line_number":96,"context_line":"            raise exception.GlusterfsException("}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_24692f8c","line":93,"in_reply_to":"7af24918_56c1d8e3","updated":"2016-03-02 16:24:00.000000000","message":"That\u0027s clear deal then ;)","commit_id":"13253c70d9e707afc36e960f30b34f452c37b4d1"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"b2657d3dc8416e566c9d78a3c9900f036fce0f7e","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def parse(cls, address):"},{"line_number":91,"context_line":"        \"\"\"Format and parse address string into component dict.\"\"\""},{"line_number":92,"context_line":"        if address.endswith(\u0027/\u0027):"},{"line_number":93,"context_line":"            address \u003d address[:-1]"},{"line_number":94,"context_line":"        m \u003d cls.scheme.search(address)"},{"line_number":95,"context_line":"        if not m:"},{"line_number":96,"context_line":"            raise exception.GlusterfsException("}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_8483e355","line":93,"in_reply_to":"7af24918_a01aa06c","updated":"2016-03-02 16:24:00.000000000","message":"I did not encourage you to do any kind of path normalization. I just found partial path normalization dubious, and asked you that once you seem to find merit in path normalization, why don\u0027t you go all the way?","commit_id":"13253c70d9e707afc36e960f30b34f452c37b4d1"},{"author":{"_account_id":16629,"name":"Andrea Ma","email":"ayma@us.ibm.com","username":"ayma"},"change_message_id":"e374947923c25cdfa69d422e75d113d8830f8f41","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def parse(cls, address):"},{"line_number":91,"context_line":"        \"\"\"Format and parse address string into component dict.\"\"\""},{"line_number":92,"context_line":"        if address.endswith(\u0027/\u0027):"},{"line_number":93,"context_line":"            address \u003d address[:-1]"},{"line_number":94,"context_line":"        m \u003d cls.scheme.search(address)"},{"line_number":95,"context_line":"        if not m:"},{"line_number":96,"context_line":"            raise exception.GlusterfsException("}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_a01aa06c","line":93,"in_reply_to":"9aed3d3a_9ae00698","updated":"2016-03-01 15:24:37.000000000","message":"I noticed that if there was a \u0027/\u0027 at the end then the parse would add that to the path.  So instead of path being None it was \u0027/\u0027\n\nWhen I checked against the test cases to see if path being \u0027/\u0027 was valid it seemed to cause failures because in another section of the code \u0027/\u0027 was getting added which would cause it now to be \u0027//\u0027  \n\nI can make the change to remove duplicate slash and single/double-dot-path-component-elimination","commit_id":"13253c70d9e707afc36e960f30b34f452c37b4d1"},{"author":{"_account_id":16629,"name":"Andrea Ma","email":"ayma@us.ibm.com","username":"ayma"},"change_message_id":"537cfafdac92416849ac1c8729d973a31df7dd13","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    def parse(cls, address):"},{"line_number":91,"context_line":"        \"\"\"Format and parse address string into component dict.\"\"\""},{"line_number":92,"context_line":"        if address.endswith(\u0027/\u0027):"},{"line_number":93,"context_line":"            address \u003d address[:-1]"},{"line_number":94,"context_line":"        m \u003d cls.scheme.search(address)"},{"line_number":95,"context_line":"        if not m:"},{"line_number":96,"context_line":"            raise exception.GlusterfsException("}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_56c1d8e3","line":93,"in_reply_to":"9aed3d3a_9ae00698","updated":"2016-03-01 19:00:15.000000000","message":"thought about it more and I guess we don\u0027t need to do path normalization.  \n\nNot a good way to remove single/double dot path components and probably makes sense to do all or none.  A simple remove of the \u0027..\u0027 doesn\u0027t quite make sense and hard to manipulate the string.","commit_id":"13253c70d9e707afc36e960f30b34f452c37b4d1"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"0d37b975dd415b80bde4cf436cfc445b64e05f17","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                address +\u003d tmp_addr.get(\u0027host\u0027)"},{"line_number":130,"context_line":"            if tmp_addr.get(\u0027volume\u0027) is not None:"},{"line_number":131,"context_line":"                address +\u003d \u0027:/\u0027 + tmp_addr.get(\u0027volume\u0027)"},{"line_number":132,"context_line":"                address +\u003d \u0027/\u0027 + tmp_addr.get(\u0027path\u0027, \"\")"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        self.components \u003d self.parse(address)"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_5a015e37","line":132,"updated":"2016-02-29 23:18:36.000000000","message":"Hm, I realized what\u0027s wrong about it.\n\n{\u0027host\u0027: \"johndoe@example.com\"} will pass.\n\nThis could be fixed by checking if the outcome of self.parse() agrees with the original dict.\n\nThat would also make sure to reject dicts with superfluous keys, which could as well be tolerated, but probably better not, so that inputs with typos like {\u0027host\u0027: \"example.com\", \u0027volume\u0027: \"trantor\", \u0027pith\u0027: \"somewhere/over/the/rainbow\"} won\u0027t be accepted as a gluster address spec with host and volume keys (and some junk).","commit_id":"13253c70d9e707afc36e960f30b34f452c37b4d1"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"c7225325b36ba340909a72c7db5d62248f3c49f2","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            \"\"\"verify that the original dictionary"},{"line_number":141,"context_line":"               matches the parsed dictionary"},{"line_number":142,"context_line":"            \"\"\""},{"line_number":143,"context_line":"            if self.components !\u003d tmp_components:"},{"line_number":144,"context_line":"                raise exception.GlusterfsException("},{"line_number":145,"context_line":"                    _(\u0027Invalid gluster address %s.\u0027) % address)"},{"line_number":146,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7af24918_60084a2d","line":143,"updated":"2016-03-02 16:24:24.000000000","message":"So what you do is that simultaneously build up a string representation of the address and sanitize the input dict. That\u0027s not clean, because string building is essentially procedural (stateful), while sanizitation is essentially functional (stateless). Also while the logic of the string building is clear, the logic behind sanitization is much more ambiguous. Therefore please separate these two actions.\n\nFor example what you do as sanitization could be represented as:\n\n  tmp_components \u003d dict((key, address.get(key)) for key in self.scheme.groupindex)\n  if tmp_components[\u0027volume\u0027] is None:\n      tmp_components[\u0027path\u0027] \u003d None\n    \n\nThen it shall be made crystal clear that you apply two sanitization measures: 1. omit keys that do not represent GlusterManager components; 2. ignore \u0027path\u0027 if \u0027volume\u0027 is missing.\n\nAnd for all sanitization steps you should provide rationale in a comment. As indicated in my earlier review comment, I can accept 1., but personally lean against it (I also told why). As of 2., I find it completely unjustified at the moment. But I\u0027m open to being convinced ;) -- so please either resign of them or make a good case for them.\n\nAlso in the light of these I suggest to use \"sanitized\" as the name prefix instead of \"tmp\" (for the dict, I mean; \"tmp_addr\" is fine).","commit_id":"fdc713adfb29cff26d1f26f5572286eaf345336d"},{"author":{"_account_id":16629,"name":"Andrea Ma","email":"ayma@us.ibm.com","username":"ayma"},"change_message_id":"48e700584de6fb97153bf0a7cdd45b116274cc3d","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            \"\"\"verify that the original dictionary"},{"line_number":141,"context_line":"               matches the parsed dictionary"},{"line_number":142,"context_line":"            \"\"\""},{"line_number":143,"context_line":"            if self.components !\u003d tmp_components:"},{"line_number":144,"context_line":"                raise exception.GlusterfsException("},{"line_number":145,"context_line":"                    _(\u0027Invalid gluster address %s.\u0027) % address)"},{"line_number":146,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7af24918_90967dee","line":143,"in_reply_to":"7af24918_60084a2d","updated":"2016-03-02 17:03:23.000000000","message":"reason for ignoring path if volume is missing was because if there was no volume given, then I thought the nfs mount would not work.  You could mount just the vol but not the path.  However I think to export the dir, then it required the volume to be exported.  I might have been wrong about this.","commit_id":"fdc713adfb29cff26d1f26f5572286eaf345336d"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"7af8034e31f4702fc88e633b35dbee1c2f153f02","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            \"\"\"verify that the original dictionary"},{"line_number":141,"context_line":"               matches the parsed dictionary"},{"line_number":142,"context_line":"            \"\"\""},{"line_number":143,"context_line":"            if self.components !\u003d tmp_components:"},{"line_number":144,"context_line":"                raise exception.GlusterfsException("},{"line_number":145,"context_line":"                    _(\u0027Invalid gluster address %s.\u0027) % address)"},{"line_number":146,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7af24918_6b3b029d","line":143,"in_reply_to":"7af24918_90967dee","updated":"2016-03-02 17:09:20.000000000","message":"That\u0027s the exact reason to *not* ignore the path if it\u0027s present while the volume is amiss -- it\u0027s bogus spec. You should not attempt to sanitize away the bogosity, but indicate error.","commit_id":"fdc713adfb29cff26d1f26f5572286eaf345336d"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"75b6d54291e547b9fb667983b7b8947d83b4abe7","unresolved":false,"context_lines":[{"line_number":129,"context_line":"            if address.get(\u0027path\u0027) is not None:"},{"line_number":130,"context_line":"                tmp_addr +\u003d address.get(\u0027path\u0027)"},{"line_number":131,"context_line":"            self.components \u003d self.parse(tmp_addr)"},{"line_number":132,"context_line":"            \"\"\"verify that the original dictionary matches the parsed"},{"line_number":133,"context_line":"               dictionary. Extra keys will need to be flagged as an error."},{"line_number":134,"context_line":"            \"\"\""},{"line_number":135,"context_line":"            for key in address:"},{"line_number":136,"context_line":"                if address.get(key) !\u003d self.components.get(key):"},{"line_number":137,"context_line":"                    raise exception.GlusterfsException("}],"source_content_type":"text/x-python","patch_set":9,"id":"7af24918_f8534e37","line":134,"range":{"start_line":132,"start_character":12,"end_line":134,"end_character":15},"updated":"2016-03-03 02:12:48.000000000","message":"What you need is a block comment:\n\n    https://www.python.org/dev/peps/pep-0008/#block-comments\n\n\nNot a docstring:\n\n    https://www.python.org/dev/peps/pep-0008/#documentation-strings","commit_id":"87370aaefd17f6e00943f87ec3aa884dfbfca8a2"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"75b6d54291e547b9fb667983b7b8947d83b4abe7","unresolved":false,"context_lines":[{"line_number":133,"context_line":"               dictionary. Extra keys will need to be flagged as an error."},{"line_number":134,"context_line":"            \"\"\""},{"line_number":135,"context_line":"            for key in address:"},{"line_number":136,"context_line":"                if address.get(key) !\u003d self.components.get(key):"},{"line_number":137,"context_line":"                    raise exception.GlusterfsException("},{"line_number":138,"context_line":"                        _(\u0027Invalid gluster address %s.\u0027) % self.components)"},{"line_number":139,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"7af24918_2e0bac8f","line":136,"range":{"start_line":136,"start_character":16,"end_line":136,"end_character":63},"updated":"2016-03-03 02:12:48.000000000","message":"If your intention is just check for the presence of extra keys, you should try\n\n    address.keys() \u003d\u003d self.components.keys()","commit_id":"87370aaefd17f6e00943f87ec3aa884dfbfca8a2"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"119aaf79f8597c931e6860c650fa9afe1773e696","unresolved":false,"context_lines":[{"line_number":133,"context_line":"               dictionary. Extra keys will need to be flagged as an error."},{"line_number":134,"context_line":"            \"\"\""},{"line_number":135,"context_line":"            for key in address:"},{"line_number":136,"context_line":"                if address.get(key) !\u003d self.components.get(key):"},{"line_number":137,"context_line":"                    raise exception.GlusterfsException("},{"line_number":138,"context_line":"                        _(\u0027Invalid gluster address %s.\u0027) % self.components)"},{"line_number":139,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"7af24918_9ca2f749","line":136,"in_reply_to":"7af24918_2e0bac8f","updated":"2016-03-03 04:22:19.000000000","message":"At this point there should be just a simple dict equality check.\nI guess what defeats a direct\n\n   address \u003d\u003d self.component\n\ncheck is that in self.component the absent components will still be keys with value None, while in address they don\u0027t occur at all.\n\nMy suggestion: sanitize address like this:\n\n   sanitized_address \u003d dict((key, None) for key in self.scheme.groupindex)\n   sanitized_address.update(address)\n\nand then perform the check against sanitized_address:\n\n   sanitized_address \u003d\u003d self.component","commit_id":"87370aaefd17f6e00943f87ec3aa884dfbfca8a2"},{"author":{"_account_id":16629,"name":"Andrea Ma","email":"ayma@us.ibm.com","username":"ayma"},"change_message_id":"d59dc4d4ba685bafe7d16034a7d087e5954a40dc","unresolved":false,"context_lines":[{"line_number":133,"context_line":"               dictionary. Extra keys will need to be flagged as an error."},{"line_number":134,"context_line":"            \"\"\""},{"line_number":135,"context_line":"            for key in address:"},{"line_number":136,"context_line":"                if address.get(key) !\u003d self.components.get(key):"},{"line_number":137,"context_line":"                    raise exception.GlusterfsException("},{"line_number":138,"context_line":"                        _(\u0027Invalid gluster address %s.\u0027) % self.components)"},{"line_number":139,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"7af24918_f6223251","line":136,"range":{"start_line":136,"start_character":16,"end_line":136,"end_character":63},"in_reply_to":"7af24918_2e0bac8f","updated":"2016-03-03 07:41:56.000000000","message":"not to just check the presence of extra keys.  Want to check that the parsed dictionary matches the original dictionary.  This indicates if there are any typos.  I will update the comments to indicate that its to check for typos too.","commit_id":"87370aaefd17f6e00943f87ec3aa884dfbfca8a2"}],"manila/tests/share/drivers/glusterfs/test_common.py":[{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"0d37b975dd415b80bde4cf436cfc445b64e05f17","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        test_gluster_manager \u003d common.GlusterManager("},{"line_number":164,"context_line":"            test_addr_dict, self.fake_execf,"},{"line_number":165,"context_line":"            requires\u003d{\u0027volume\u0027: has_volume})"},{"line_number":166,"context_line":"        self.assertIsNone(test_gluster_manager.volume)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"    def test_gluster_manager_init_has_shouldnt_have_vol(self):"},{"line_number":169,"context_line":"        self.assertRaises(exception.GlusterfsException,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_7a742267","line":166,"updated":"2016-02-29 23:18:36.000000000","message":"It\u0027s nice that you check if the \u0027requires\u0027 option works properly, \nbut you could add some test cases of  more \"holistic\" character, to see if the whole parsing process delivers what\u0027s expected, with doing a test for\n\n    self.assertEqual(test_addr_dict, test_gluster_manager.components)\n\n(\"Some test cases\": a single one with ddt would do the job.)","commit_id":"13253c70d9e707afc36e960f30b34f452c37b4d1"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"0d37b975dd415b80bde4cf436cfc445b64e05f17","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        self.assertRaises(exception.GlusterfsException,"},{"line_number":204,"context_line":"                          common.GlusterManager, test_addr_dict,"},{"line_number":205,"context_line":"                          \u0027self.fake_execf\u0027)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def test_gluster_manager_getattr(self):"},{"line_number":208,"context_line":"        self.assertEqual(\u0027testvol\u0027, self._gluster_manager.volume)"},{"line_number":209,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9aed3d3a_5aa2fe99","line":206,"updated":"2016-02-29 23:18:36.000000000","message":"Please multiply this test case with ddt to check a number of invalid inputs. You could check dicts with keys [\u0027volume\u0027], [\u0027volume\u0027, \u0027path\u0027], [\u0027user\u0027,\u0027volume\u0027,\u0027path\u0027], [\u0027host\u0027, \u0027path\u0027].\n\nAlso dicts with bogus values could be checked, like {\u0027host\u0027: \"johndoe@example.com\"}, or {\u0027host\u0027: \"example.com/so\", \u0027volume\u0027: \"me/path\"}, etc.","commit_id":"13253c70d9e707afc36e960f30b34f452c37b4d1"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"c7225325b36ba340909a72c7db5d62248f3c49f2","unresolved":false,"context_lines":[{"line_number":227,"context_line":"    @ddt.data({\u0027user\u0027: \u0027testuser\u0027},"},{"line_number":228,"context_line":"              {\u0027host\u0027: \u0027johndoe@example.com\u0027},"},{"line_number":229,"context_line":"              {\u0027host\u0027: \u0027example.com/so\u0027, \u0027volume\u0027: \u0027me/path\u0027},"},{"line_number":230,"context_line":"              {\u0027host\u0027: \u0027example.com\u0027, \u0027volume\u0027: \u0027me/path\u0027, \u0027pith\u0027: \u0027path\u0027},"},{"line_number":231,"context_line":"              {\u0027user\u0027: \u0027user@error\u0027, \u0027host\u0027: \"example.com\", \u0027volume\u0027: \u0027vol\u0027})"},{"line_number":232,"context_line":"    def test_gluster_manager_dict_invalid_input(self, test_addr_dict):"},{"line_number":233,"context_line":"        self.assertRaises(exception.GlusterfsException,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7af24918_e192999e","line":230,"updated":"2016-03-02 16:24:24.000000000","message":"As long as the dict validation logic ignores non-component keys, an input with such an extra key should occur in the test case for successful parsing, not in the invalid parsing one.","commit_id":"fdc713adfb29cff26d1f26f5572286eaf345336d"},{"author":{"_account_id":9521,"name":"Csaba Henk","email":"chenk@redhat.com","username":"chenk"},"change_message_id":"7af8034e31f4702fc88e633b35dbee1c2f153f02","unresolved":false,"context_lines":[{"line_number":227,"context_line":"    @ddt.data({\u0027user\u0027: \u0027testuser\u0027},"},{"line_number":228,"context_line":"              {\u0027host\u0027: \u0027johndoe@example.com\u0027},"},{"line_number":229,"context_line":"              {\u0027host\u0027: \u0027example.com/so\u0027, \u0027volume\u0027: \u0027me/path\u0027},"},{"line_number":230,"context_line":"              {\u0027host\u0027: \u0027example.com\u0027, \u0027volume\u0027: \u0027me/path\u0027, \u0027pith\u0027: \u0027path\u0027},"},{"line_number":231,"context_line":"              {\u0027user\u0027: \u0027user@error\u0027, \u0027host\u0027: \"example.com\", \u0027volume\u0027: \u0027vol\u0027})"},{"line_number":232,"context_line":"    def test_gluster_manager_dict_invalid_input(self, test_addr_dict):"},{"line_number":233,"context_line":"        self.assertRaises(exception.GlusterfsException,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7af24918_4ba1e6a2","line":230,"in_reply_to":"7af24918_501cf511","updated":"2016-03-02 17:09:20.000000000","message":"Yes, so besides of having the extra key passing test, it\u0027s confusing here. It\u0027s just digital noise, does not have a function.","commit_id":"fdc713adfb29cff26d1f26f5572286eaf345336d"},{"author":{"_account_id":16629,"name":"Andrea Ma","email":"ayma@us.ibm.com","username":"ayma"},"change_message_id":"48e700584de6fb97153bf0a7cdd45b116274cc3d","unresolved":false,"context_lines":[{"line_number":227,"context_line":"    @ddt.data({\u0027user\u0027: \u0027testuser\u0027},"},{"line_number":228,"context_line":"              {\u0027host\u0027: \u0027johndoe@example.com\u0027},"},{"line_number":229,"context_line":"              {\u0027host\u0027: \u0027example.com/so\u0027, \u0027volume\u0027: \u0027me/path\u0027},"},{"line_number":230,"context_line":"              {\u0027host\u0027: \u0027example.com\u0027, \u0027volume\u0027: \u0027me/path\u0027, \u0027pith\u0027: \u0027path\u0027},"},{"line_number":231,"context_line":"              {\u0027user\u0027: \u0027user@error\u0027, \u0027host\u0027: \"example.com\", \u0027volume\u0027: \u0027vol\u0027})"},{"line_number":232,"context_line":"    def test_gluster_manager_dict_invalid_input(self, test_addr_dict):"},{"line_number":233,"context_line":"        self.assertRaises(exception.GlusterfsException,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7af24918_501cf511","line":230,"in_reply_to":"7af24918_e192999e","updated":"2016-03-02 17:03:23.000000000","message":"this one fails because the volume is bad but yes i should probably put a test case for extra key passing","commit_id":"fdc713adfb29cff26d1f26f5572286eaf345336d"}]}
