)]}'
{"cinder/volume/drivers/nexenta/utils.py":[{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"556441a933d946f906257ddbf327df777bd0c294","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    groups \u003d match.groups()"},{"line_number":44,"context_line":"    value \u003d float(groups[0])"},{"line_number":45,"context_line":"    suffix \u003d groups[1].upper() if len(groups) \u003e 1 and groups[1].upper() \\"},{"line_number":46,"context_line":"        else \u0027B\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    types \u003d (\u0027B\u0027, \u0027K\u0027, \u0027M\u0027, \u0027G\u0027, \u0027T\u0027, \u0027P\u0027, \u0027E\u0027, \u0027Z\u0027, \u0027Y\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_eb5a864e","line":45,"range":{"start_line":45,"start_character":72,"end_line":45,"end_character":73},"updated":"2017-08-31 23:42:37.000000000","message":"If this is what the logic needs to be that is fine but can we handle the line wrapping with () instead of \\ please?","commit_id":"774826b467311ff1d422662db2f598373d2e09ae"},{"author":{"_account_id":25571,"name":"Rajat Sharma","email":"rajat.sharma@india.nec.com","username":"rajat29"},"change_message_id":"d2b47c8d3ba7c4b239645a203c6e7516a74e4eae","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    groups \u003d match.groups()"},{"line_number":44,"context_line":"    value \u003d float(groups[0])"},{"line_number":45,"context_line":"    suffix \u003d groups[1].upper() if len(groups) \u003e 1 and groups[1].upper() \\"},{"line_number":46,"context_line":"        else \u0027B\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    types \u003d (\u0027B\u0027, \u0027K\u0027, \u0027M\u0027, \u0027G\u0027, \u0027T\u0027, \u0027P\u0027, \u0027E\u0027, \u0027Z\u0027, \u0027Y\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_8cb6f53d","line":45,"range":{"start_line":45,"start_character":50,"end_line":45,"end_character":71},"updated":"2017-08-28 04:58:30.000000000","message":"why we need this in condition?","commit_id":"774826b467311ff1d422662db2f598373d2e09ae"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"b8d157364b855b765a56fb4329ccf3356cade360","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    groups \u003d match.groups()"},{"line_number":44,"context_line":"    value \u003d float(groups[0])"},{"line_number":45,"context_line":"    suffix \u003d groups[1].upper() if len(groups) \u003e 1 and groups[1].upper() \\"},{"line_number":46,"context_line":"        else \u0027B\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    types \u003d (\u0027B\u0027, \u0027K\u0027, \u0027M\u0027, \u0027G\u0027, \u0027T\u0027, \u0027P\u0027, \u0027E\u0027, \u0027Z\u0027, \u0027Y\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_9601343b","line":45,"in_reply_to":"7f287b81_2cbf01b1","updated":"2017-08-29 16:24:11.000000000","message":"Surely there\u0027s a less complicated way to write this...","commit_id":"774826b467311ff1d422662db2f598373d2e09ae"},{"author":{"_account_id":25245,"name":"Chris Suttles","email":"suttles@gmail.com","username":"csuttles"},"change_message_id":"ab102ca6f3d0c59d62922b7b283ca3705e889ff0","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    groups \u003d match.groups()"},{"line_number":44,"context_line":"    value \u003d float(groups[0])"},{"line_number":45,"context_line":"    suffix \u003d groups[1].upper() if len(groups) \u003e 1 and groups[1].upper() \\"},{"line_number":46,"context_line":"        else \u0027B\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    types \u003d (\u0027B\u0027, \u0027K\u0027, \u0027M\u0027, \u0027G\u0027, \u0027T\u0027, \u0027P\u0027, \u0027E\u0027, \u0027Z\u0027, \u0027Y\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_2cbf01b1","line":45,"in_reply_to":"7f287b81_8cb6f53d","updated":"2017-08-28 05:36:46.000000000","message":"It appears to be there for type checking, to see if the match contains a string. If I take that out, py27 unit test fails on:\n\ncinder.tests.unit.volume.drivers.nexenta.test_nexenta.TestNexentaUtils.test_str2size\n\nIt fails in the (None, 0) case.\n\nI think the idea is for the type checking to make the ternary fall through to default of \u0027B\u0027 when types are not a string.","commit_id":"774826b467311ff1d422662db2f598373d2e09ae"},{"author":{"_account_id":25245,"name":"Chris Suttles","email":"suttles@gmail.com","username":"csuttles"},"change_message_id":"21bee26644f337f1b10e7bdd5c406cacff421ee8","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    groups \u003d match.groups()"},{"line_number":44,"context_line":"    value \u003d float(groups[0])"},{"line_number":45,"context_line":"    suffix \u003d groups[1].upper() if len(groups) \u003e 1 and groups[1].upper() \\"},{"line_number":46,"context_line":"        else \u0027B\u0027"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    types \u003d (\u0027B\u0027, \u0027K\u0027, \u0027M\u0027, \u0027G\u0027, \u0027T\u0027, \u0027P\u0027, \u0027E\u0027, \u0027Z\u0027, \u0027Y\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_d90fef85","line":45,"in_reply_to":"7f287b81_9601343b","updated":"2017-08-29 16:58:25.000000000","message":"First diff was an if / else that was much less clunky IMO, but feedback was to use a ternary instead. Removing the groups[1].upper() breaks a type check in unit tests, so this is what I came up with based on feedback so far. It\u0027s one character too long for a single line. I\u0027m open to any suggestions for improving it. :)","commit_id":"774826b467311ff1d422662db2f598373d2e09ae"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"970046ae44ebdb110d29432fdefdd31069d0d6e4","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    groups \u003d match.groups()"},{"line_number":44,"context_line":"    value \u003d float(groups[0])"},{"line_number":45,"context_line":"    suffix \u003d (groups[1].upper() if len(groups) \u003e 1 and groups[1].upper()"},{"line_number":46,"context_line":"              else \u0027B\u0027)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    types \u003d (\u0027B\u0027, \u0027K\u0027, \u0027M\u0027, \u0027G\u0027, \u0027T\u0027, \u0027P\u0027, \u0027E\u0027, \u0027Z\u0027, \u0027Y\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_51d6b9f3","line":45,"range":{"start_line":45,"start_character":50,"end_line":45,"end_character":72},"updated":"2017-09-04 11:47:29.000000000","message":"-1: groups[1] will never be an empty string since it\u0027s not a valid regex match.","commit_id":"fc7655a52921a05f48ddd9b331fa366920fd7511"},{"author":{"_account_id":25245,"name":"Chris Suttles","email":"suttles@gmail.com","username":"csuttles"},"change_message_id":"309f708092bff7a45a936d2c41efa4a415a9fafe","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    groups \u003d match.groups()"},{"line_number":44,"context_line":"    value \u003d float(groups[0])"},{"line_number":45,"context_line":"    suffix \u003d (groups[1].upper() if len(groups) \u003e 1 and groups[1].upper()"},{"line_number":46,"context_line":"              else \u0027B\u0027)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    types \u003d (\u0027B\u0027, \u0027K\u0027, \u0027M\u0027, \u0027G\u0027, \u0027T\u0027, \u0027P\u0027, \u0027E\u0027, \u0027Z\u0027, \u0027Y\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_b52dc247","line":45,"range":{"start_line":45,"start_character":50,"end_line":45,"end_character":72},"in_reply_to":"7f287b81_51d6b9f3","updated":"2017-09-04 17:04:50.000000000","message":"It is an empty string in one of the cases in unit test:\n\nIn [1]: import re\n\nIn [2]: s \u003d \u002710\u0027\n\nIn [3]:     match \u003d re.match(r\u0027^([\\.\\d]+)\\s*([BbKkMmGgTtPpEeZzYy]?)\u0027, s)\n   ...:     if match is None:\n   ...:         raise ValueError(_(\u0027Invalid value: \"%s\"\u0027) % s)\n   ...:\n\nIn [4]: groups \u003d match.groups()\n\nIn [5]: groups[0]\nOut[5]: \u002710\u0027\n\nIn [6]: groups[1]\nOut[6]: \u0027\u0027\n\nThat input (\u002710\u0027) is based on this unit test:\n\ncinder/tests/unit/volume/drivers/nexenta/test_nexenta.py 657:1","commit_id":"fc7655a52921a05f48ddd9b331fa366920fd7511"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"02edf80024cc86cf828a16236e0504bb12cb476d","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    groups \u003d match.groups()"},{"line_number":44,"context_line":"    value \u003d float(groups[0])"},{"line_number":45,"context_line":"    suffix \u003d (groups[1].upper() if len(groups) \u003e 1 and groups[1].upper()"},{"line_number":46,"context_line":"              else \u0027B\u0027)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    types \u003d (\u0027B\u0027, \u0027K\u0027, \u0027M\u0027, \u0027G\u0027, \u0027T\u0027, \u0027P\u0027, \u0027E\u0027, \u0027Z\u0027, \u0027Y\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f287b81_541696a9","line":45,"range":{"start_line":45,"start_character":50,"end_line":45,"end_character":72},"in_reply_to":"7f287b81_b52dc247","updated":"2017-09-05 08:58:15.000000000","message":"I missed that we\u0027ll always have 2 groups, my bad.\n\nThen you really don\u0027t need to check the length of the groups, because you\u0027ll always have 2 groups, and the second one will either be an empty string or on of the single letters defined for the second group.\n\n suffix \u003d groups[1].upper() if groups[1] else \u0027B\u0027\n\nAlthough I admit for this case I prefer using the or similar to how it was done before, but I understand wanting to change it for clarity:\n\n suffix \u003d groups[1].upper() or \u0027B\u0027","commit_id":"fc7655a52921a05f48ddd9b331fa366920fd7511"}]}
