)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b5be98aa2868458dd5d9ff96850f6d8dfac145a0","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     zhaobo \u003czhaobo6@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-10-29 11:12:51 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix return inappropriate message when run net-list -F {fields}"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Run neutron net-list -F ${which not contained fields},it will return"},{"line_number":10,"context_line":"some inappropriate info, the expected from neutronclient is throwing error"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"1a26ad4f_c45a8c50","line":7,"updated":"2015-10-29 05:30:01.000000000","message":"COmmit heading should be of 50 characters max, while the rest of the body must be limited to 70 chars.","commit_id":"e6e4eb11aa059182a5d52f3f06e54d50b7a520c6"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0f17c820fc78c6c94d5914ecb58eac9f63af463d","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     zhaobo \u003czhaobo6@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-10-29 11:12:51 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix return inappropriate message when run net-list -F {fields}"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Run neutron net-list -F ${which not contained fields},it will return"},{"line_number":10,"context_line":"some inappropriate info, the expected from neutronclient is throwing error"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"1a26ad4f_5abe4cd5","line":7,"in_reply_to":"1a26ad4f_c45a8c50","updated":"2015-10-29 09:17:24.000000000","message":"Done","commit_id":"e6e4eb11aa059182a5d52f3f06e54d50b7a520c6"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b5be98aa2868458dd5d9ff96850f6d8dfac145a0","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Run neutron net-list -F ${which not contained fields},it will return"},{"line_number":10,"context_line":"some inappropriate info, the expected from neutronclient is throwing error"},{"line_number":11,"context_line":"In this view, the result from neutron-server is like [\u0027network\u0027:[{},{}]],"},{"line_number":12,"context_line":"So the logic should throw an exception .This patch fix that when the result"},{"line_number":13,"context_line":"like [{},{}], it will raise ListFieldsInvalid exception."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-Bug: #1489678"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"1a26ad4f_84549421","line":12,"updated":"2015-10-29 05:30:01.000000000","message":"Please insert a space after the .","commit_id":"e6e4eb11aa059182a5d52f3f06e54d50b7a520c6"},{"author":{"_account_id":16788,"name":"Ramanjaneya Reddy Palleti","email":"ramanjaneya.palleti@huawei.com","username":"Ramanjaneya"},"change_message_id":"63c4b6b6756adfa7a0d02c3d43f697b91ebc8f9a","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Run neutron net-list -F ${which not contained fields},it will return"},{"line_number":10,"context_line":"some inappropriate info, the expected from neutronclient is throwing error"},{"line_number":11,"context_line":"In this view, the result from neutron-server is like [\u0027network\u0027:[{},{}]],"},{"line_number":12,"context_line":"So the logic should throw an exception .This patch fix that when the result"},{"line_number":13,"context_line":"like [{},{}], it will raise ListFieldsInvalid exception."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-Bug: #1489678"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"1a26ad4f_5a096cdc","line":12,"updated":"2015-10-29 09:16:16.000000000","message":"exception .This  \u003d\u003d\u003d\u003e exception. This","commit_id":"e6e4eb11aa059182a5d52f3f06e54d50b7a520c6"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0f17c820fc78c6c94d5914ecb58eac9f63af463d","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Run neutron net-list -F ${which not contained fields},it will return"},{"line_number":10,"context_line":"some inappropriate info, the expected from neutronclient is throwing error"},{"line_number":11,"context_line":"In this view, the result from neutron-server is like [\u0027network\u0027:[{},{}]],"},{"line_number":12,"context_line":"So the logic should throw an exception .This patch fix that when the result"},{"line_number":13,"context_line":"like [{},{}], it will raise ListFieldsInvalid exception."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-Bug: #1489678"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"1a26ad4f_fab4f8f2","line":12,"in_reply_to":"1a26ad4f_84549421","updated":"2015-10-29 09:17:24.000000000","message":"Done","commit_id":"e6e4eb11aa059182a5d52f3f06e54d50b7a520c6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"14c82e269b41e76bc6ef7f48d4681336bed75a8a","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Run neutron net-list -F ${which not contained fields}, it will return"},{"line_number":10,"context_line":"some inappropriate info, the expected from neutronclient is throwing"},{"line_number":11,"context_line":"error. In this view, the result from neutron-server is just like"},{"line_number":12,"context_line":"[\u0027network\u0027:[{},{}]], So the logic should throw an exception."},{"line_number":13,"context_line":"This patch fix that when the result like [{},{}], it will raise"},{"line_number":14,"context_line":"InvalidResultError exception."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"da85f559_5f67c94c","line":12,"updated":"2015-11-11 17:23:23.000000000","message":"Do you mean {\u0027network\u0027:[{},{}]}?","commit_id":"5e9bf57db61842a45468519879c34be611e9f70d"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"06d1a5887ac664dcd173acf518c855ae08ebc433","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Run neutron net-list -F ${which not contained fields}, it will return"},{"line_number":10,"context_line":"some inappropriate info, the expected from neutronclient is throwing"},{"line_number":11,"context_line":"error. In this view, the result from neutron-server is just like"},{"line_number":12,"context_line":"[\u0027network\u0027:[{},{}]], So the logic should throw an exception."},{"line_number":13,"context_line":"This patch fix that when the result like [{},{}], it will raise"},{"line_number":14,"context_line":"InvalidResultError exception."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"da85f559_a537b14b","line":12,"in_reply_to":"da85f559_5f67c94c","updated":"2015-11-12 01:22:21.000000000","message":"Thanks for review. When I use -F with any wrong field to send list request. The result should be like this. And neutron client didn\u0027t know it mean nothing, and even process it, so the user will get strong CLI output.","commit_id":"5e9bf57db61842a45468519879c34be611e9f70d"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"37c6957a845f1daa0a8a2a0ecc7688268a54bd61","unresolved":false,"context_lines":[{"line_number":11,"context_line":"error. In this view, the result from neutron-server is just like"},{"line_number":12,"context_line":"[\u0027network\u0027:[{},{}]], So the logic should throw an exception."},{"line_number":13,"context_line":"This patch fix that when the result like [{},{}], it will raise"},{"line_number":14,"context_line":"MeaninglessResultError exception."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Closes-Bug: #1489678"},{"line_number":17,"context_line":"Change-Id: I23b3d3a9e9728cf946df37bfdcaefa875beb1e84"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"7af24918_766206da","line":14,"updated":"2016-03-07 05:56:47.000000000","message":"I can find we are returning \"InvalidResult\" exception and not \"MeaninglessResultError\"","commit_id":"948a279caa98e599ad6e59fe69dfdfb7918cd894"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0f07a2c3e2faabd10f8bd459e53c166135890285","unresolved":false,"context_lines":[{"line_number":11,"context_line":"error. In this view, the result from neutron-server is just like"},{"line_number":12,"context_line":"[\u0027network\u0027:[{},{}]], So the logic should throw an exception."},{"line_number":13,"context_line":"This patch fix that when the result like [{},{}], it will raise"},{"line_number":14,"context_line":"MeaninglessResultError exception."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Closes-Bug: #1489678"},{"line_number":17,"context_line":"Change-Id: I23b3d3a9e9728cf946df37bfdcaefa875beb1e84"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"5aef4532_6373964e","line":14,"in_reply_to":"7af24918_766206da","updated":"2016-03-08 01:10:59.000000000","message":"@vikram, thanks for correct. I miss this.","commit_id":"948a279caa98e599ad6e59fe69dfdfb7918cd894"}],"neutronclient/common/exceptions.py":[{"author":{"_account_id":12999,"name":"James Arendt","email":"james.arendt@hpe.com","username":"jwarendt"},"change_message_id":"97faf80071890a9c4d68f0ff86d531a26d1ca72f","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class InvalidResultError(NeutronClientException):"},{"line_number":199,"context_line":"    message \u003d _(\"Invalid Result Returned: %(reason)s\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"class SslCertificateValidationError(NeutronClientException):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a26ad4f_62da1a4e","line":199,"updated":"2015-11-02 23:32:55.000000000","message":"Other messages appear to follow common English sentence capitalization rules, so this should be \"Invalid result returned:\".","commit_id":"5d8f1c7947475c134f66248ecb9f468317173ec6"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"c7050ae9604df51b883223293f9cd22668babfa6","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class InvalidResultError(NeutronClientException):"},{"line_number":199,"context_line":"    message \u003d _(\"Invalid Result Returned: %(reason)s\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"class SslCertificateValidationError(NeutronClientException):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a26ad4f_9346a64d","line":199,"in_reply_to":"1a26ad4f_62da1a4e","updated":"2015-11-03 01:34:31.000000000","message":"Thanks for review.It\u0027s right.Thanks for correct me.","commit_id":"5d8f1c7947475c134f66248ecb9f468317173ec6"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"4fa1e0a8f24c0390f50bab44837cf3b57f39ad53","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class InvalidResultError(NeutronClientException):"},{"line_number":199,"context_line":"    message \u003d _(\"Invalid result returned: %(reason)s\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"class SslCertificateValidationError(NeutronClientException):"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a710552_2530269e","line":199,"updated":"2015-12-16 08:15:44.000000000","message":"how about rewording it to \"No meaningful result returned.\"?","commit_id":"423ca1bf48f9e905818cb59842ffe8267b02704f"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"e46076fda5073f66221a27e0808debf691dc8892","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class InvalidResultError(NeutronClientException):"},{"line_number":199,"context_line":"    message \u003d _(\"Invalid result returned: %(reason)s\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"class SslCertificateValidationError(NeutronClientException):"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a7e1126_9fc143e7","line":199,"in_reply_to":"5a710552_2530269e","updated":"2015-12-17 09:25:19.000000000","message":"Thanks, I will update it.","commit_id":"423ca1bf48f9e905818cb59842ffe8267b02704f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2823915d84b15cd8d82e9abcd9fff9c20524fdf8","unresolved":false,"context_lines":[{"line_number":195,"context_line":"    message \u003d _(\"Connection to neutron failed: %(reason)s\")"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class MeaninglessResultError(NeutronClientException):"},{"line_number":199,"context_line":"    message \u003d _(\"Meaningless result returned: %(reason)s\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_8426ce66","line":198,"updated":"2015-12-23 14:40:06.000000000","message":"This exception is now raised from the CLI layer, so the base class should be NeutronCLIError.","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"70d8b48a073991cf9c15c9607215bb10aafa50cd","unresolved":false,"context_lines":[{"line_number":195,"context_line":"    message \u003d _(\"Connection to neutron failed: %(reason)s\")"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class MeaninglessResultError(NeutronClientException):"},{"line_number":199,"context_line":"    message \u003d _(\"Meaningless result returned: %(reason)s\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_73ba4f70","line":198,"in_reply_to":"1a7b0d38_8426ce66","updated":"2015-12-25 11:06:58.000000000","message":"Done","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"ad3a93566977e3e41508e0105f553bebd4cee7c5","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class MeaninglessResultError(NeutronClientException):"},{"line_number":199,"context_line":"    message \u003d _(\"Meaningless result returned: %(reason)s\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"class SslCertificateValidationError(NeutronClientException):"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a7e1126_92db9c4f","line":199,"updated":"2015-12-22 14:02:39.000000000","message":"From the users perspective, \"meaningless\" implies that some results were returned when in fact the results were empty.","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2823915d84b15cd8d82e9abcd9fff9c20524fdf8","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class MeaninglessResultError(NeutronClientException):"},{"line_number":199,"context_line":"    message \u003d _(\"Meaningless result returned: %(reason)s\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"class SslCertificateValidationError(NeutronClientException):"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_c405b6c2","line":199,"in_reply_to":"1a7b0d38_241b5a74","updated":"2015-12-23 14:40:06.000000000","message":"I am not sure the case we are discussing is really invalid. This is the reason I suggested \u0027meaningless\u0027 in the past comment, but \u0027meaningless\u0027 does not sound good to others. Others prefer to \"invalid\" more. I am okay with \"invalid\". At least it is not empty because the returned list not empty.","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"752101dce7adaa89bc813e0ed65bfdb5f7d439a8","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class MeaninglessResultError(NeutronClientException):"},{"line_number":199,"context_line":"    message \u003d _(\"Meaningless result returned: %(reason)s\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"class SslCertificateValidationError(NeutronClientException):"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_241b5a74","line":199,"in_reply_to":"1a7b0d38_265ff973","updated":"2015-12-23 14:19:16.000000000","message":"Maybe InvalidResult or EmptyResult instead of MeaninglessResult","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"a787abb07f7268ea3e0e57a8bccce0330817ace4","unresolved":false,"context_lines":[{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class MeaninglessResultError(NeutronClientException):"},{"line_number":199,"context_line":"    message \u003d _(\"Meaningless result returned: %(reason)s\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"class SslCertificateValidationError(NeutronClientException):"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_265ff973","line":199,"in_reply_to":"3a7e1126_92db9c4f","updated":"2015-12-23 01:58:01.000000000","message":"Thanks, I follow the Akihiro Motoki\u0027s suggestion to make it, as I\u0027m also not sure which the correct message should be wrote here. I need your suggestion.","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2823915d84b15cd8d82e9abcd9fff9c20524fdf8","unresolved":false,"context_lines":[{"line_number":214,"context_line":"# Command line exceptions"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"class NeutronCLIError(NeutronException):"},{"line_number":217,"context_line":"    \"\"\"Exception raised when command line parsing fails.\"\"\""},{"line_number":218,"context_line":"    pass"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_e430f258","line":217,"updated":"2015-12-23 14:40:06.000000000","message":"If you follow my comment at L.198 above, could you move this docstirng to CommandError below and change this docstring to:\n\n  Exception raised from CLI layer.","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"70d8b48a073991cf9c15c9607215bb10aafa50cd","unresolved":false,"context_lines":[{"line_number":214,"context_line":"# Command line exceptions"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"class NeutronCLIError(NeutronException):"},{"line_number":217,"context_line":"    \"\"\"Exception raised when command line parsing fails.\"\"\""},{"line_number":218,"context_line":"    pass"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_93001b03","line":217,"in_reply_to":"1a7b0d38_e430f258","updated":"2015-12-25 11:06:58.000000000","message":"Done","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"2a934eafec71385f464ba0a3920140d11ee6047b","unresolved":false,"context_lines":[{"line_number":210,"context_line":"# Command line exceptions"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"class NeutronCLIError(NeutronException):"},{"line_number":213,"context_line":"    \"\"\"Exception raised from CLI layer.\"\"\""},{"line_number":214,"context_line":"    pass"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"5a5ae5dd_41e635b1","line":213,"updated":"2016-02-05 07:14:28.000000000","message":"This message is unclear to me. Could you specify it explicitly?","commit_id":"b090f0ad34055127e5ab61327436663d8d360c4d"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"5b5dbc56432457505b7249504e47a18adf8ab22a","unresolved":false,"context_lines":[{"line_number":210,"context_line":"# Command line exceptions"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"class NeutronCLIError(NeutronException):"},{"line_number":213,"context_line":"    \"\"\"Exception raised from CLI layer.\"\"\""},{"line_number":214,"context_line":"    pass"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"5a5ae5dd_8d2d3c00","line":213,"in_reply_to":"5a5ae5dd_37425b69","updated":"2016-02-05 09:02:24.000000000","message":"As an exception for \"command line parsing fails\" also can be recognized as an exception \"from CLI layer\", this makes me confused a little bit. However, this should not be a big deal.","commit_id":"b090f0ad34055127e5ab61327436663d8d360c4d"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"d34700937aaf987ca1e096419ed805c891184b56","unresolved":false,"context_lines":[{"line_number":210,"context_line":"# Command line exceptions"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"class NeutronCLIError(NeutronException):"},{"line_number":213,"context_line":"    \"\"\"Exception raised from CLI layer.\"\"\""},{"line_number":214,"context_line":"    pass"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"5a5ae5dd_ed5dd015","line":213,"in_reply_to":"5a5ae5dd_37425b69","updated":"2016-02-05 08:50:56.000000000","message":"Yes, I read that. What I\u0027m unclear is what was the reason to update the message from the previous version.","commit_id":"b090f0ad34055127e5ab61327436663d8d360c4d"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2be17f4f34c261385ba422d2f9e662ab5d06a868","unresolved":false,"context_lines":[{"line_number":210,"context_line":"# Command line exceptions"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"class NeutronCLIError(NeutronException):"},{"line_number":213,"context_line":"    \"\"\"Exception raised from CLI layer.\"\"\""},{"line_number":214,"context_line":"    pass"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"5a5ae5dd_37425b69","line":213,"in_reply_to":"5a5ae5dd_41e635b1","updated":"2016-02-05 08:18:47.000000000","message":"Have you read the comment at L.22-28?\nThis is the base class of exceptions raised from CLI code (not from the library code).\nSome more suggestion would be welcome.","commit_id":"b090f0ad34055127e5ab61327436663d8d360c4d"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"1fa28a97fece9037449eff7a60b5852f9a82040f","unresolved":false,"context_lines":[{"line_number":210,"context_line":"# Command line exceptions"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"class NeutronCLIError(NeutronException):"},{"line_number":213,"context_line":"    \"\"\"Exception raised from CLI layer.\"\"\""},{"line_number":214,"context_line":"    pass"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"5a5ae5dd_9d1485a0","line":213,"in_reply_to":"5a5ae5dd_7d44291a","updated":"2016-02-05 12:22:14.000000000","message":"This makes sense to me now.","commit_id":"b090f0ad34055127e5ab61327436663d8d360c4d"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c7deac0be00f2ef7b0403db0c384802b3dbe1f83","unresolved":false,"context_lines":[{"line_number":210,"context_line":"# Command line exceptions"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"class NeutronCLIError(NeutronException):"},{"line_number":213,"context_line":"    \"\"\"Exception raised from CLI layer.\"\"\""},{"line_number":214,"context_line":"    pass"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"5a5ae5dd_7d44291a","line":213,"in_reply_to":"5a5ae5dd_8d2d3c00","updated":"2016-02-05 12:08:38.000000000","message":"In my understanding, \u0027command line parsing error\u0027 is one of exceptions detected in CLI layer. We don\u0027t need to limit the usage of this exception for command line parsing errors. This is the background of this message change. (Perhaps I made a mistake in choosing a message when I first prepared this class.)","commit_id":"b090f0ad34055127e5ab61327436663d8d360c4d"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"37c6957a845f1daa0a8a2a0ecc7688268a54bd61","unresolved":false,"context_lines":[{"line_number":244,"context_line":""},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"class InvalidResult(NeutronCLIError):"},{"line_number":247,"context_line":"    message \u003d _(\"Invalid result returned: %(reason)s\")"}],"source_content_type":"text/x-python","patch_set":35,"id":"7af24918_b6812e50","line":247,"updated":"2016-03-07 05:56:47.000000000","message":"I am not sure if it\u0027s really invalid... If no result then why we just not keep quite....","commit_id":"948a279caa98e599ad6e59fe69dfdfb7918cd894"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0f07a2c3e2faabd10f8bd459e53c166135890285","unresolved":false,"context_lines":[{"line_number":244,"context_line":""},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"class InvalidResult(NeutronCLIError):"},{"line_number":247,"context_line":"    message \u003d _(\"Invalid result returned: %(reason)s\")"}],"source_content_type":"text/x-python","patch_set":35,"id":"5aef4532_c90ed733","line":247,"in_reply_to":"7af24918_b6812e50","updated":"2016-03-08 01:10:59.000000000","message":"@vikram, I proposed the exception named like \"meaningless\", but maybe others not like that name.:-). But I think the key of this is that we don\u0027t know which field could be input when specified F option.So we just guess the resource fields except the base fields like \u0027name\u0027, \u0027id\u0027 and etc. The server may cover these views and client side should return the meaningless result {\u0027results\u0027:[{},{}]}. Thank you.","commit_id":"948a279caa98e599ad6e59fe69dfdfb7918cd894"}],"neutronclient/common/utils.py":[{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"ca61a2129abeb0a012dc8026be7dee226de99af9","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        return False"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"def is_meaning_result(res):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_e4ef9cae","line":195,"range":{"start_line":195,"start_character":4,"end_line":195,"end_character":21},"updated":"2015-12-23 10:30:49.000000000","message":"How about renaming this to :is_result_valid\"?","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"70d8b48a073991cf9c15c9607215bb10aafa50cd","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        return False"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"def is_meaning_result(res):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_53b71386","line":195,"range":{"start_line":195,"start_character":4,"end_line":195,"end_character":21},"in_reply_to":"1a7b0d38_242d9aa7","updated":"2015-12-25 11:06:58.000000000","message":"Thanks, I will update.","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2823915d84b15cd8d82e9abcd9fff9c20524fdf8","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        return False"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"def is_meaning_result(res):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_242d9aa7","line":195,"range":{"start_line":195,"start_character":4,"end_line":195,"end_character":21},"in_reply_to":"1a7b0d38_e4ef9cae","updated":"2015-12-23 14:40:06.000000000","message":"is_xxxx method usually returns True/False as a return value but this method does not. How about renaming it to check_xxxx?","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"ad3a93566977e3e41508e0105f553bebd4cee7c5","unresolved":false,"context_lines":[{"line_number":195,"context_line":"def is_meaning_result(res):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"},{"line_number":199,"context_line":"            not any(value_list[0])):"},{"line_number":200,"context_line":"            # This judgement will process the res like"},{"line_number":201,"context_line":"            # {\u0027networks\u0027:[{},{}]} and {\u0027network\u0027: {}}, the result"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a7e1126_527bf429","line":198,"updated":"2015-12-22 14:02:39.000000000","message":"Why is only the first item checked in value_list?  Is it possible for the other items to have results?","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"752101dce7adaa89bc813e0ed65bfdb5f7d439a8","unresolved":false,"context_lines":[{"line_number":195,"context_line":"def is_meaning_result(res):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"},{"line_number":199,"context_line":"            not any(value_list[0])):"},{"line_number":200,"context_line":"            # This judgement will process the res like"},{"line_number":201,"context_line":"            # {\u0027networks\u0027:[{},{}]} and {\u0027network\u0027: {}}, the result"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_c131280d","line":198,"in_reply_to":"1a7b0d38_066d1d04","updated":"2015-12-23 14:19:16.000000000","message":"I\u0027m referring to value_list[1] and greater.  Is it possible for these to have different results?","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"70d8b48a073991cf9c15c9607215bb10aafa50cd","unresolved":false,"context_lines":[{"line_number":195,"context_line":"def is_meaning_result(res):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"},{"line_number":199,"context_line":"            not any(value_list[0])):"},{"line_number":200,"context_line":"            # This judgement will process the res like"},{"line_number":201,"context_line":"            # {\u0027networks\u0027:[{},{}]} and {\u0027network\u0027: {}}, the result"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_3086fdb9","line":198,"in_reply_to":"1a7b0d38_c131280d","updated":"2015-12-25 11:06:58.000000000","message":"No, there is only one element in the result.","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"a787abb07f7268ea3e0e57a8bccce0330817ace4","unresolved":false,"context_lines":[{"line_number":195,"context_line":"def is_meaning_result(res):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"},{"line_number":199,"context_line":"            not any(value_list[0])):"},{"line_number":200,"context_line":"            # This judgement will process the res like"},{"line_number":201,"context_line":"            # {\u0027networks\u0027:[{},{}]} and {\u0027network\u0027: {}}, the result"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_066d1d04","line":198,"in_reply_to":"3a7e1126_527bf429","updated":"2015-12-23 01:58:01.000000000","message":"As this err should be hit since show / list resource, the result data struct is like 1key to 1value. So the first item is the all result. If I miss something, could you please show the view you said? thanks.","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"ad3a93566977e3e41508e0105f553bebd4cee7c5","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            # request, and neutron  client should not process this"},{"line_number":204,"context_line":"            # result and output to users through CLI. So when the"},{"line_number":205,"context_line":"            # result like this should raise MeaninglessResultError."},{"line_number":206,"context_line":"        msg \u003d _(\"Non-exist fields you specified, %(res_count)s results\""},{"line_number":207,"context_line":"                \"would have been shown, but all of returned results \""},{"line_number":208,"context_line":"                \"%(results)s to show were empty after \""},{"line_number":209,"context_line":"                \"process method \u0027%(method)s\u0027\")"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a7e1126_b286d8d9","line":206,"updated":"2015-12-22 14:02:39.000000000","message":"I suggest the following wording: \"The fields specified do not exist.","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"70d8b48a073991cf9c15c9607215bb10aafa50cd","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            # request, and neutron  client should not process this"},{"line_number":204,"context_line":"            # result and output to users through CLI. So when the"},{"line_number":205,"context_line":"            # result like this should raise MeaninglessResultError."},{"line_number":206,"context_line":"        msg \u003d _(\"Non-exist fields you specified, %(res_count)s results\""},{"line_number":207,"context_line":"                \"would have been shown, but all of returned results \""},{"line_number":208,"context_line":"                \"%(results)s to show were empty after \""},{"line_number":209,"context_line":"                \"process method \u0027%(method)s\u0027\")"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_d0abf91b","line":206,"in_reply_to":"1a7b0d38_a4bbd4c3","updated":"2015-12-25 11:06:58.000000000","message":"Done","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"ca61a2129abeb0a012dc8026be7dee226de99af9","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            # request, and neutron  client should not process this"},{"line_number":204,"context_line":"            # result and output to users through CLI. So when the"},{"line_number":205,"context_line":"            # result like this should raise MeaninglessResultError."},{"line_number":206,"context_line":"        msg \u003d _(\"Non-exist fields you specified, %(res_count)s results\""},{"line_number":207,"context_line":"                \"would have been shown, but all of returned results \""},{"line_number":208,"context_line":"                \"%(results)s to show were empty after \""},{"line_number":209,"context_line":"                \"process method \u0027%(method)s\u0027\")"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_a4bbd4c3","line":206,"in_reply_to":"3a7e1126_b286d8d9","updated":"2015-12-23 10:30:49.000000000","message":"+1","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"a787abb07f7268ea3e0e57a8bccce0330817ace4","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            # request, and neutron  client should not process this"},{"line_number":204,"context_line":"            # result and output to users through CLI. So when the"},{"line_number":205,"context_line":"            # result like this should raise MeaninglessResultError."},{"line_number":206,"context_line":"        msg \u003d _(\"Non-exist fields you specified, %(res_count)s results\""},{"line_number":207,"context_line":"                \"would have been shown, but all of returned results \""},{"line_number":208,"context_line":"                \"%(results)s to show were empty after \""},{"line_number":209,"context_line":"                \"process method \u0027%(method)s\u0027\")"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_06443d72","line":206,"in_reply_to":"3a7e1126_b286d8d9","updated":"2015-12-23 01:58:01.000000000","message":"Thanks, the message is more readable. :-)","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"ad3a93566977e3e41508e0105f553bebd4cee7c5","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        msg \u003d _(\"Non-exist fields you specified, %(res_count)s results\""},{"line_number":207,"context_line":"                \"would have been shown, but all of returned results \""},{"line_number":208,"context_line":"                \"%(results)s to show were empty after \""},{"line_number":209,"context_line":"                \"process method \u0027%(method)s\u0027\")"},{"line_number":210,"context_line":"        msg \u003d msg % {\u0027res_count\u0027: len(value_list[0]),"},{"line_number":211,"context_line":"                     \u0027method\u0027: \u0027GET\u0027 if isinstance(value_list[0],"},{"line_number":212,"context_line":"                                                   dict) else \u0027LIST\u0027,"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a7e1126_5201b438","line":209,"updated":"2015-12-22 14:02:39.000000000","message":"I don\u0027t think that the users cares about the method being GET or LIST. Rather the results were empty after processing the fields that don\u0027t exist.","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"70d8b48a073991cf9c15c9607215bb10aafa50cd","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        msg \u003d _(\"Non-exist fields you specified, %(res_count)s results\""},{"line_number":207,"context_line":"                \"would have been shown, but all of returned results \""},{"line_number":208,"context_line":"                \"%(results)s to show were empty after \""},{"line_number":209,"context_line":"                \"process method \u0027%(method)s\u0027\")"},{"line_number":210,"context_line":"        msg \u003d msg % {\u0027res_count\u0027: len(value_list[0]),"},{"line_number":211,"context_line":"                     \u0027method\u0027: \u0027GET\u0027 if isinstance(value_list[0],"},{"line_number":212,"context_line":"                                                   dict) else \u0027LIST\u0027,"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_73a32f50","line":209,"in_reply_to":"1a7b0d38_81b6c088","updated":"2015-12-25 11:06:58.000000000","message":"Done","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"752101dce7adaa89bc813e0ed65bfdb5f7d439a8","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        msg \u003d _(\"Non-exist fields you specified, %(res_count)s results\""},{"line_number":207,"context_line":"                \"would have been shown, but all of returned results \""},{"line_number":208,"context_line":"                \"%(results)s to show were empty after \""},{"line_number":209,"context_line":"                \"process method \u0027%(method)s\u0027\")"},{"line_number":210,"context_line":"        msg \u003d msg % {\u0027res_count\u0027: len(value_list[0]),"},{"line_number":211,"context_line":"                     \u0027method\u0027: \u0027GET\u0027 if isinstance(value_list[0],"},{"line_number":212,"context_line":"                                                   dict) else \u0027LIST\u0027,"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_81b6c088","line":209,"in_reply_to":"1a7b0d38_a9b65a3b","updated":"2015-12-23 14:19:16.000000000","message":"It could be replaced by the fields specified which cased the results to be empty.","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"a787abb07f7268ea3e0e57a8bccce0330817ace4","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        msg \u003d _(\"Non-exist fields you specified, %(res_count)s results\""},{"line_number":207,"context_line":"                \"would have been shown, but all of returned results \""},{"line_number":208,"context_line":"                \"%(results)s to show were empty after \""},{"line_number":209,"context_line":"                \"process method \u0027%(method)s\u0027\")"},{"line_number":210,"context_line":"        msg \u003d msg % {\u0027res_count\u0027: len(value_list[0]),"},{"line_number":211,"context_line":"                     \u0027method\u0027: \u0027GET\u0027 if isinstance(value_list[0],"},{"line_number":212,"context_line":"                                                   dict) else \u0027LIST\u0027,"}],"source_content_type":"text/x-python","patch_set":23,"id":"1a7b0d38_a9b65a3b","line":209,"in_reply_to":"3a7e1126_5201b438","updated":"2015-12-23 01:58:01.000000000","message":"net-show : GET\nnet-list : LIST\nI think the method info can distinguish which operation users input. Do you suggest this info should be removed or replaced by other info which more useful?","commit_id":"fb458710c755e84250ed15d07638dcde0a606641"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1cc9c928879a2e709baaf93aaf9dcb1c26f881b6","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"def check_result_valid(res, fields):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"},{"line_number":199,"context_line":"            not any(value_list[0])):"}],"source_content_type":"text/x-python","patch_set":24,"id":"fa69d971_1a074d19","line":196,"updated":"2016-01-04 21:33:25.000000000","message":"Why is list() needed? values() returns a list.","commit_id":"c4c5f376865d3d52d309059694067783f38dae32"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"8e8f45cade790cb23662159610cf5c554b1d55f8","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"def check_result_valid(res, fields):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"},{"line_number":199,"context_line":"            not any(value_list[0])):"}],"source_content_type":"text/x-python","patch_set":24,"id":"da6ed579_a6b371e8","line":196,"in_reply_to":"da6ed579_b606511b","updated":"2016-01-14 09:28:53.000000000","message":"Thanks for the clarification. I completely forgot it.","commit_id":"c4c5f376865d3d52d309059694067783f38dae32"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"994736817ef40af455e951d9cd123245f2de7fc9","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"def check_result_valid(res, fields):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"},{"line_number":199,"context_line":"            not any(value_list[0])):"}],"source_content_type":"text/x-python","patch_set":24,"id":"da6ed579_b606511b","line":196,"in_reply_to":"fa69d971_1a074d19","updated":"2016-01-14 02:49:20.000000000","message":"In python 34, dict.values didn\u0027t return a list. So should call list() to convert it.","commit_id":"c4c5f376865d3d52d309059694067783f38dae32"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1cc9c928879a2e709baaf93aaf9dcb1c26f881b6","unresolved":false,"context_lines":[{"line_number":195,"context_line":"def check_result_valid(res, fields):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"},{"line_number":199,"context_line":"            not any(value_list[0])):"},{"line_number":200,"context_line":"            # This judgement will process the res like"},{"line_number":201,"context_line":"            # {\u0027networks\u0027:[{},{}]} and {\u0027network\u0027: {}}, the result"}],"source_content_type":"text/x-python","patch_set":24,"id":"fa69d971_1aa3cd01","line":198,"updated":"2016-01-04 21:33:25.000000000","message":"Why do you check \u0027\u003e1\u0027?\n\nI think we need to raise InvalidResult for a case of res \u003d\u003d \"{\u0027networks\u0027: [{}]}\", but the current logic doesn\u0027t cover this.","commit_id":"c4c5f376865d3d52d309059694067783f38dae32"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"994736817ef40af455e951d9cd123245f2de7fc9","unresolved":false,"context_lines":[{"line_number":195,"context_line":"def check_result_valid(res, fields):"},{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"},{"line_number":199,"context_line":"            not any(value_list[0])):"},{"line_number":200,"context_line":"            # This judgement will process the res like"},{"line_number":201,"context_line":"            # {\u0027networks\u0027:[{},{}]} and {\u0027network\u0027: {}}, the result"}],"source_content_type":"text/x-python","patch_set":24,"id":"da6ed579_b1065b1b","line":198,"in_reply_to":"fa69d971_1aa3cd01","updated":"2016-01-14 02:49:20.000000000","message":"Yeah , we should check like [{}] when there is only 1 resource and input the not-exist field to do list. I will update it and check it won\u0027t affect other UTs.","commit_id":"c4c5f376865d3d52d309059694067783f38dae32"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1cc9c928879a2e709baaf93aaf9dcb1c26f881b6","unresolved":false,"context_lines":[{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"},{"line_number":199,"context_line":"            not any(value_list[0])):"},{"line_number":200,"context_line":"            # This judgement will process the res like"},{"line_number":201,"context_line":"            # {\u0027networks\u0027:[{},{}]} and {\u0027network\u0027: {}}, the result"},{"line_number":202,"context_line":"            # like this mean that there is nothing returned after"}],"source_content_type":"text/x-python","patch_set":24,"id":"fa69d971_484bbe87","line":199,"updated":"2016-01-04 21:33:25.000000000","message":"Hmm....  it looks like a strange indent level. The indent level of 2nd and 3rd lines should match. The current indent level is hard to read.","commit_id":"c4c5f376865d3d52d309059694067783f38dae32"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"994736817ef40af455e951d9cd123245f2de7fc9","unresolved":false,"context_lines":[{"line_number":196,"context_line":"    value_list \u003d list(res.values())"},{"line_number":197,"context_line":"    if (res and"},{"line_number":198,"context_line":"        (isinstance(value_list[0], dict) or len(value_list[0]) \u003e 1) and"},{"line_number":199,"context_line":"            not any(value_list[0])):"},{"line_number":200,"context_line":"            # This judgement will process the res like"},{"line_number":201,"context_line":"            # {\u0027networks\u0027:[{},{}]} and {\u0027network\u0027: {}}, the result"},{"line_number":202,"context_line":"            # like this mean that there is nothing returned after"}],"source_content_type":"text/x-python","patch_set":24,"id":"da6ed579_f1185377","line":199,"in_reply_to":"fa69d971_484bbe87","updated":"2016-01-14 02:49:20.000000000","message":"Thanks, it is. I will make it look better.:-)","commit_id":"c4c5f376865d3d52d309059694067783f38dae32"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1cc9c928879a2e709baaf93aaf9dcb1c26f881b6","unresolved":false,"context_lines":[{"line_number":202,"context_line":"            # like this mean that there is nothing returned after"},{"line_number":203,"context_line":"            # request, and neutron client should not process this"},{"line_number":204,"context_line":"            # result and output to users through CLI. So when the"},{"line_number":205,"context_line":"            # result like this should raise MeaninglessResultError."},{"line_number":206,"context_line":"        msg \u003d _(\"The fields %(fields)s specified do not exist, %(res_count)s \""},{"line_number":207,"context_line":"                \"results would have been shown, but all of returned results \""},{"line_number":208,"context_line":"                \"%(results)s to show were empty.\")"}],"source_content_type":"text/x-python","patch_set":24,"id":"fa69d971_c8b1ee90","line":205,"range":{"start_line":205,"start_character":44,"end_line":205,"end_character":66},"updated":"2016-01-04 21:33:25.000000000","message":"-\u003e InvalidResult","commit_id":"c4c5f376865d3d52d309059694067783f38dae32"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"994736817ef40af455e951d9cd123245f2de7fc9","unresolved":false,"context_lines":[{"line_number":202,"context_line":"            # like this mean that there is nothing returned after"},{"line_number":203,"context_line":"            # request, and neutron client should not process this"},{"line_number":204,"context_line":"            # result and output to users through CLI. So when the"},{"line_number":205,"context_line":"            # result like this should raise MeaninglessResultError."},{"line_number":206,"context_line":"        msg \u003d _(\"The fields %(fields)s specified do not exist, %(res_count)s \""},{"line_number":207,"context_line":"                \"results would have been shown, but all of returned results \""},{"line_number":208,"context_line":"                \"%(results)s to show were empty.\")"}],"source_content_type":"text/x-python","patch_set":24,"id":"da6ed579_511eff5f","line":205,"range":{"start_line":205,"start_character":44,"end_line":205,"end_character":66},"in_reply_to":"fa69d971_c8b1ee90","updated":"2016-01-14 02:49:20.000000000","message":"Thanks, nice catch.","commit_id":"c4c5f376865d3d52d309059694067783f38dae32"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"dc03bd309dcd0b583b716e03e299417a3b4ec8e6","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        return False"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"def check_result_valid(res, fields):"},{"line_number":200,"context_line":"    value_list \u003d list(res.values())"},{"line_number":201,"context_line":"    if (res and"},{"line_number":202,"context_line":"            ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba63e191_e46a451a","line":199,"updated":"2016-01-19 03:25:56.000000000","message":"This method is complicated. Could you add a docstring to describe this method? In addition, it is better to describe the parameters this method takes.","commit_id":"53c99942c191d0a592e301b15e51922d4ca54c5c"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0d95400cade3a9431e1e9fa2762a7feab18c902e","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        return False"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"def check_result_valid(res, fields):"},{"line_number":200,"context_line":"    value_list \u003d list(res.values())"},{"line_number":201,"context_line":"    if (res and"},{"line_number":202,"context_line":"            ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba63e191_cb6aac1a","line":199,"in_reply_to":"ba63e191_e46a451a","updated":"2016-01-19 06:27:12.000000000","message":"Thanks, I will add it.","commit_id":"53c99942c191d0a592e301b15e51922d4ca54c5c"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"e408588b3a9f9ada5c158b4ac0315233747ccda7","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"def check_result_valid(res, fields):"},{"line_number":200,"context_line":"    value_list \u003d list(res.values())"},{"line_number":201,"context_line":"    if (res and"},{"line_number":202,"context_line":"            ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"},{"line_number":203,"context_line":"             isinstance(value_list[0], dict)) and"},{"line_number":204,"context_line":"            not any(value_list[0])):"}],"source_content_type":"text/x-python","patch_set":27,"id":"da6ed579_34d6bdf1","line":201,"updated":"2016-01-14 13:49:18.000000000","message":"I don\u0027t think you need to check res here since the previous line already references it.  Should this check be moved with the previous line?","commit_id":"53c99942c191d0a592e301b15e51922d4ca54c5c"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"90076b57e48661ab71525a0ce285fa10bc0744b7","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"def check_result_valid(res, fields):"},{"line_number":200,"context_line":"    value_list \u003d list(res.values())"},{"line_number":201,"context_line":"    if (res and"},{"line_number":202,"context_line":"            ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"},{"line_number":203,"context_line":"             isinstance(value_list[0], dict)) and"},{"line_number":204,"context_line":"            not any(value_list[0])):"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba63e191_baf9c4ca","line":201,"in_reply_to":"ba63e191_8477c901","updated":"2016-01-19 04:13:35.000000000","message":"More thought. We need to check if value_list is not empty as we refer to [0].\n\nFrom this complexity, we need more unit tests which cover both exception cases and normal cases.","commit_id":"53c99942c191d0a592e301b15e51922d4ca54c5c"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0d95400cade3a9431e1e9fa2762a7feab18c902e","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"def check_result_valid(res, fields):"},{"line_number":200,"context_line":"    value_list \u003d list(res.values())"},{"line_number":201,"context_line":"    if (res and"},{"line_number":202,"context_line":"            ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"},{"line_number":203,"context_line":"             isinstance(value_list[0], dict)) and"},{"line_number":204,"context_line":"            not any(value_list[0])):"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba63e191_eb8210c8","line":201,"in_reply_to":"ba63e191_baf9c4ca","updated":"2016-01-19 06:27:12.000000000","message":"Thanks for suggesion. I agree with remove res. It is true, the res here must be not null. But value_list will never null, even the returned res is like {\u0027resource\u0027:{}} or {\u0027resources\u0027:[]}, value_list get the data through res.values(), so finally the value_list is [{}] or [[]], we can still get the element 0.","commit_id":"53c99942c191d0a592e301b15e51922d4ca54c5c"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"dc03bd309dcd0b583b716e03e299417a3b4ec8e6","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"def check_result_valid(res, fields):"},{"line_number":200,"context_line":"    value_list \u003d list(res.values())"},{"line_number":201,"context_line":"    if (res and"},{"line_number":202,"context_line":"            ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"},{"line_number":203,"context_line":"             isinstance(value_list[0], dict)) and"},{"line_number":204,"context_line":"            not any(value_list[0])):"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba63e191_8477c901","line":201,"in_reply_to":"da6ed579_34d6bdf1","updated":"2016-01-19 03:25:56.000000000","message":"+1 for dropping the check of \"res\" here. No need.","commit_id":"53c99942c191d0a592e301b15e51922d4ca54c5c"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"71db49a9efcd96a5339987ba0c07db60eafba870","unresolved":false,"context_lines":[{"line_number":197,"context_line":""},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"def check_result_valid(res, fields):"},{"line_number":200,"context_line":"    \"\"\"Check result when specified fields."},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    During show or list resource specified non-exist fields, the results"},{"line_number":203,"context_line":"    returned from neutron server are like:"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_735e0eeb","line":200,"range":{"start_line":200,"start_character":13,"end_line":200,"end_character":19},"updated":"2016-01-19 09:23:14.000000000","message":"the result","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0da20913fe57a4d4c712af2607e5c5f7bfa67fcc","unresolved":false,"context_lines":[{"line_number":197,"context_line":""},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"def check_result_valid(res, fields):"},{"line_number":200,"context_line":"    \"\"\"Check result when specified fields."},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    During show or list resource specified non-exist fields, the results"},{"line_number":203,"context_line":"    returned from neutron server are like:"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_9e3149a5","line":200,"range":{"start_line":200,"start_character":13,"end_line":200,"end_character":19},"in_reply_to":"ba63e191_735e0eeb","updated":"2016-01-19 09:28:54.000000000","message":"Done","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"71db49a9efcd96a5339987ba0c07db60eafba870","unresolved":false,"context_lines":[{"line_number":199,"context_line":"def check_result_valid(res, fields):"},{"line_number":200,"context_line":"    \"\"\"Check result when specified fields."},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    During show or list resource specified non-exist fields, the results"},{"line_number":203,"context_line":"    returned from neutron server are like:"},{"line_number":204,"context_line":"    {\u0027resource\u0027: {}}, {\u0027resources\u0027:[{},{}]}"},{"line_number":205,"context_line":"    These result are meaningless, so this function care about whether result"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_73884e23","line":202,"range":{"start_line":202,"start_character":11,"end_line":202,"end_character":23},"updated":"2016-01-19 09:23:14.000000000","message":"better to keep the consistency as following - \u0027show/list\u0027.","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0da20913fe57a4d4c712af2607e5c5f7bfa67fcc","unresolved":false,"context_lines":[{"line_number":199,"context_line":"def check_result_valid(res, fields):"},{"line_number":200,"context_line":"    \"\"\"Check result when specified fields."},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"    During show or list resource specified non-exist fields, the results"},{"line_number":203,"context_line":"    returned from neutron server are like:"},{"line_number":204,"context_line":"    {\u0027resource\u0027: {}}, {\u0027resources\u0027:[{},{}]}"},{"line_number":205,"context_line":"    These result are meaningless, so this function care about whether result"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_3e261d69","line":202,"range":{"start_line":202,"start_character":11,"end_line":202,"end_character":23},"in_reply_to":"ba63e191_73884e23","updated":"2016-01-19 09:28:54.000000000","message":"Done","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"71db49a9efcd96a5339987ba0c07db60eafba870","unresolved":false,"context_lines":[{"line_number":202,"context_line":"    During show or list resource specified non-exist fields, the results"},{"line_number":203,"context_line":"    returned from neutron server are like:"},{"line_number":204,"context_line":"    {\u0027resource\u0027: {}}, {\u0027resources\u0027:[{},{}]}"},{"line_number":205,"context_line":"    These result are meaningless, so this function care about whether result"},{"line_number":206,"context_line":"    like them will raise InvalidResult exception."},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    :param res: the final result of show/list resource from neutron server"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_9ea069f6","line":205,"range":{"start_line":205,"start_character":4,"end_line":205,"end_character":20},"updated":"2016-01-19 09:23:14.000000000","message":"The result is","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"71db49a9efcd96a5339987ba0c07db60eafba870","unresolved":false,"context_lines":[{"line_number":202,"context_line":"    During show or list resource specified non-exist fields, the results"},{"line_number":203,"context_line":"    returned from neutron server are like:"},{"line_number":204,"context_line":"    {\u0027resource\u0027: {}}, {\u0027resources\u0027:[{},{}]}"},{"line_number":205,"context_line":"    These result are meaningless, so this function care about whether result"},{"line_number":206,"context_line":"    like them will raise InvalidResult exception."},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    :param res: the final result of show/list resource from neutron server"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_d3c57a5b","line":205,"range":{"start_line":205,"start_character":51,"end_line":205,"end_character":55},"updated":"2016-01-19 09:23:14.000000000","message":"cares","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0da20913fe57a4d4c712af2607e5c5f7bfa67fcc","unresolved":false,"context_lines":[{"line_number":202,"context_line":"    During show or list resource specified non-exist fields, the results"},{"line_number":203,"context_line":"    returned from neutron server are like:"},{"line_number":204,"context_line":"    {\u0027resource\u0027: {}}, {\u0027resources\u0027:[{},{}]}"},{"line_number":205,"context_line":"    These result are meaningless, so this function care about whether result"},{"line_number":206,"context_line":"    like them will raise InvalidResult exception."},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    :param res: the final result of show/list resource from neutron server"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_5e2bd130","line":205,"range":{"start_line":205,"start_character":4,"end_line":205,"end_character":20},"in_reply_to":"ba63e191_9ea069f6","updated":"2016-01-19 09:28:54.000000000","message":"Done","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"71db49a9efcd96a5339987ba0c07db60eafba870","unresolved":false,"context_lines":[{"line_number":202,"context_line":"    During show or list resource specified non-exist fields, the results"},{"line_number":203,"context_line":"    returned from neutron server are like:"},{"line_number":204,"context_line":"    {\u0027resource\u0027: {}}, {\u0027resources\u0027:[{},{}]}"},{"line_number":205,"context_line":"    These result are meaningless, so this function care about whether result"},{"line_number":206,"context_line":"    like them will raise InvalidResult exception."},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    :param res: the final result of show/list resource from neutron server"},{"line_number":209,"context_line":"    :param fields: fields what want to show in request"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_de8d817c","line":206,"range":{"start_line":205,"start_character":70,"end_line":206,"end_character":49},"updated":"2016-01-19 09:23:14.000000000","message":"it should be raised by an InvalidResult exception or not.","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0da20913fe57a4d4c712af2607e5c5f7bfa67fcc","unresolved":false,"context_lines":[{"line_number":202,"context_line":"    During show or list resource specified non-exist fields, the results"},{"line_number":203,"context_line":"    returned from neutron server are like:"},{"line_number":204,"context_line":"    {\u0027resource\u0027: {}}, {\u0027resources\u0027:[{},{}]}"},{"line_number":205,"context_line":"    These result are meaningless, so this function care about whether result"},{"line_number":206,"context_line":"    like them will raise InvalidResult exception."},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    :param res: the final result of show/list resource from neutron server"},{"line_number":209,"context_line":"    :param fields: fields what want to show in request"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_fe20854b","line":206,"range":{"start_line":205,"start_character":70,"end_line":206,"end_character":49},"in_reply_to":"ba63e191_de8d817c","updated":"2016-01-19 09:28:54.000000000","message":"Done","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"71db49a9efcd96a5339987ba0c07db60eafba870","unresolved":false,"context_lines":[{"line_number":216,"context_line":"    value_list \u003d list(res.values())"},{"line_number":217,"context_line":"    if ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"},{"line_number":218,"context_line":"            isinstance(value_list[0], dict)) and not any(value_list[0]):"},{"line_number":219,"context_line":"            # This judgement will process the res like {\u0027networks\u0027:[{},{}]},"},{"line_number":220,"context_line":"            # {\u0027networks\u0027:[{}]} and {\u0027network\u0027: {}}, the result"},{"line_number":221,"context_line":"            # like this mean that there is nothing returned after"},{"line_number":222,"context_line":"            # request, and neutron client should not process this"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_5e5c3125","line":219,"range":{"start_line":219,"start_character":29,"end_line":219,"end_character":41},"updated":"2016-01-19 09:23:14.000000000","message":"processes","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0da20913fe57a4d4c712af2607e5c5f7bfa67fcc","unresolved":false,"context_lines":[{"line_number":216,"context_line":"    value_list \u003d list(res.values())"},{"line_number":217,"context_line":"    if ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"},{"line_number":218,"context_line":"            isinstance(value_list[0], dict)) and not any(value_list[0]):"},{"line_number":219,"context_line":"            # This judgement will process the res like {\u0027networks\u0027:[{},{}]},"},{"line_number":220,"context_line":"            # {\u0027networks\u0027:[{}]} and {\u0027network\u0027: {}}, the result"},{"line_number":221,"context_line":"            # like this mean that there is nothing returned after"},{"line_number":222,"context_line":"            # request, and neutron client should not process this"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_5eb991e8","line":219,"range":{"start_line":219,"start_character":29,"end_line":219,"end_character":41},"in_reply_to":"ba63e191_5e5c3125","updated":"2016-01-19 09:28:54.000000000","message":"Done","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"71db49a9efcd96a5339987ba0c07db60eafba870","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            isinstance(value_list[0], dict)) and not any(value_list[0]):"},{"line_number":219,"context_line":"            # This judgement will process the res like {\u0027networks\u0027:[{},{}]},"},{"line_number":220,"context_line":"            # {\u0027networks\u0027:[{}]} and {\u0027network\u0027: {}}, the result"},{"line_number":221,"context_line":"            # like this mean that there is nothing returned after"},{"line_number":222,"context_line":"            # request, and neutron client should not process this"},{"line_number":223,"context_line":"            # result and output to users through CLI. So when the"},{"line_number":224,"context_line":"            # result like this should raise InvalidResult."}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_3e57fd03","line":221,"range":{"start_line":221,"start_character":24,"end_line":221,"end_character":28},"updated":"2016-01-19 09:23:14.000000000","message":"means","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0da20913fe57a4d4c712af2607e5c5f7bfa67fcc","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            isinstance(value_list[0], dict)) and not any(value_list[0]):"},{"line_number":219,"context_line":"            # This judgement will process the res like {\u0027networks\u0027:[{},{}]},"},{"line_number":220,"context_line":"            # {\u0027networks\u0027:[{}]} and {\u0027network\u0027: {}}, the result"},{"line_number":221,"context_line":"            # like this mean that there is nothing returned after"},{"line_number":222,"context_line":"            # request, and neutron client should not process this"},{"line_number":223,"context_line":"            # result and output to users through CLI. So when the"},{"line_number":224,"context_line":"            # result like this should raise InvalidResult."}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_fece4582","line":221,"range":{"start_line":221,"start_character":24,"end_line":221,"end_character":28},"in_reply_to":"ba63e191_3e57fd03","updated":"2016-01-19 09:28:54.000000000","message":"Done","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"71db49a9efcd96a5339987ba0c07db60eafba870","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            # This judgement will process the res like {\u0027networks\u0027:[{},{}]},"},{"line_number":220,"context_line":"            # {\u0027networks\u0027:[{}]} and {\u0027network\u0027: {}}, the result"},{"line_number":221,"context_line":"            # like this mean that there is nothing returned after"},{"line_number":222,"context_line":"            # request, and neutron client should not process this"},{"line_number":223,"context_line":"            # result and output to users through CLI. So when the"},{"line_number":224,"context_line":"            # result like this should raise InvalidResult."},{"line_number":225,"context_line":"        msg \u003d _(\"The fields %(fields)s specified do not exist, %(res_count)s \""}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_1e3f99b5","line":222,"range":{"start_line":222,"start_character":14,"end_line":222,"end_character":21},"updated":"2016-01-19 09:23:14.000000000","message":"the request","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0da20913fe57a4d4c712af2607e5c5f7bfa67fcc","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            # This judgement will process the res like {\u0027networks\u0027:[{},{}]},"},{"line_number":220,"context_line":"            # {\u0027networks\u0027:[{}]} and {\u0027network\u0027: {}}, the result"},{"line_number":221,"context_line":"            # like this mean that there is nothing returned after"},{"line_number":222,"context_line":"            # request, and neutron client should not process this"},{"line_number":223,"context_line":"            # result and output to users through CLI. So when the"},{"line_number":224,"context_line":"            # result like this should raise InvalidResult."},{"line_number":225,"context_line":"        msg \u003d _(\"The fields %(fields)s specified do not exist, %(res_count)s \""}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_1ecc7988","line":222,"range":{"start_line":222,"start_character":14,"end_line":222,"end_character":21},"in_reply_to":"ba63e191_1e3f99b5","updated":"2016-01-19 09:28:54.000000000","message":"Done","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"a8dacc897bba5f429b4a590359e50c60ca982771","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            # This judgement will process the res like {\u0027networks\u0027:[{},{}]},"},{"line_number":220,"context_line":"            # {\u0027networks\u0027:[{}]} and {\u0027network\u0027: {}}, the result"},{"line_number":221,"context_line":"            # like this mean that there is nothing returned after"},{"line_number":222,"context_line":"            # request, and neutron client should not process this"},{"line_number":223,"context_line":"            # result and output to users through CLI. So when the"},{"line_number":224,"context_line":"            # result like this should raise InvalidResult."},{"line_number":225,"context_line":"        msg \u003d _(\"The fields %(fields)s specified do not exist, %(res_count)s \""}],"source_content_type":"text/x-python","patch_set":28,"id":"ba63e191_5e1431f4","line":222,"range":{"start_line":222,"start_character":14,"end_line":222,"end_character":21},"in_reply_to":"ba63e191_1e3f99b5","updated":"2016-01-19 09:27:24.000000000","message":"Hmm, all of them are quite right.","commit_id":"98aeeca96ee89862ffdf27fd4b840ded61810541"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9f6812e70aa6a93ec659e2c9afa85013bed6d14f","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    The result is meaningless, so this function cares about whether result"},{"line_number":206,"context_line":"    like them, and it should be raised by an InvalidResult exception or not."},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    :param res: the final result of show/list resource from neutron server"},{"line_number":209,"context_line":"    :param fields: fields what want to show in request"},{"line_number":210,"context_line":"    :raises InvalidResult if result is invalid"},{"line_number":211,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_d0e7a510","line":208,"updated":"2016-01-19 12:14:43.000000000","message":"It is better to mention that it should a form of {\u0027resource(s)\u0027: \u003cactual value\u003e}.","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"78c69e403d8a709745c2ba5d6db9267e6b04ccea","unresolved":false,"context_lines":[{"line_number":205,"context_line":"    The result is meaningless, so this function cares about whether result"},{"line_number":206,"context_line":"    like them, and it should be raised by an InvalidResult exception or not."},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    :param res: the final result of show/list resource from neutron server"},{"line_number":209,"context_line":"    :param fields: fields what want to show in request"},{"line_number":210,"context_line":"    :raises InvalidResult if result is invalid"},{"line_number":211,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_1f99a21f","line":208,"in_reply_to":"ba63e191_d0e7a510","updated":"2016-01-20 02:48:19.000000000","message":"Agree","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9f6812e70aa6a93ec659e2c9afa85013bed6d14f","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    :param fields: fields what want to show in request"},{"line_number":210,"context_line":"    :raises InvalidResult if result is invalid"},{"line_number":211,"context_line":"    \"\"\""},{"line_number":212,"context_line":"    # We should let it pass when not specified fields and the res"},{"line_number":213,"context_line":"    # returned is like {\u0027resources\u0027: []} when list resources."},{"line_number":214,"context_line":"    if not fields:"},{"line_number":215,"context_line":"        return"},{"line_number":216,"context_line":"    value_list \u003d list(res.values())"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_5074159b","line":213,"range":{"start_line":212,"start_character":58,"end_line":213,"end_character":60},"updated":"2016-01-19 12:14:43.000000000","message":"L.214 is \"if not fields\".\nIs this description correct?","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"78c69e403d8a709745c2ba5d6db9267e6b04ccea","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    :param fields: fields what want to show in request"},{"line_number":210,"context_line":"    :raises InvalidResult if result is invalid"},{"line_number":211,"context_line":"    \"\"\""},{"line_number":212,"context_line":"    # We should let it pass when not specified fields and the res"},{"line_number":213,"context_line":"    # returned is like {\u0027resources\u0027: []} when list resources."},{"line_number":214,"context_line":"    if not fields:"},{"line_number":215,"context_line":"        return"},{"line_number":216,"context_line":"    value_list \u003d list(res.values())"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_df154a49","line":213,"range":{"start_line":212,"start_character":58,"end_line":213,"end_character":60},"in_reply_to":"ba63e191_5074159b","updated":"2016-01-20 02:48:19.000000000","message":"Thanks , I will correct it.","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9f6812e70aa6a93ec659e2c9afa85013bed6d14f","unresolved":false,"context_lines":[{"line_number":211,"context_line":"    \"\"\""},{"line_number":212,"context_line":"    # We should let it pass when not specified fields and the res"},{"line_number":213,"context_line":"    # returned is like {\u0027resources\u0027: []} when list resources."},{"line_number":214,"context_line":"    if not fields:"},{"line_number":215,"context_line":"        return"},{"line_number":216,"context_line":"    value_list \u003d list(res.values())"},{"line_number":217,"context_line":"    if ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_96e28602","line":214,"updated":"2016-01-19 12:14:43.000000000","message":"\"fields\" parameter is used only for message. I think it is safe not to depend on a parameter used only for a message.","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9f6812e70aa6a93ec659e2c9afa85013bed6d14f","unresolved":false,"context_lines":[{"line_number":213,"context_line":"    # returned is like {\u0027resources\u0027: []} when list resources."},{"line_number":214,"context_line":"    if not fields:"},{"line_number":215,"context_line":"        return"},{"line_number":216,"context_line":"    value_list \u003d list(res.values())"},{"line_number":217,"context_line":"    if ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"},{"line_number":218,"context_line":"            isinstance(value_list[0], dict)) and not any(value_list[0]):"},{"line_number":219,"context_line":"            # This judgement processes the res like {\u0027networks\u0027:[{},{}]},"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_909fed5e","line":216,"range":{"start_line":216,"start_character":4,"end_line":216,"end_character":35},"updated":"2016-01-19 12:14:43.000000000","message":"How about\n\n  result \u003d list(res.values())[0]\n\nIn our case, value_list always contains a single element because it is retruned from values().\n\nI think it is easier to read.","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"78c69e403d8a709745c2ba5d6db9267e6b04ccea","unresolved":false,"context_lines":[{"line_number":213,"context_line":"    # returned is like {\u0027resources\u0027: []} when list resources."},{"line_number":214,"context_line":"    if not fields:"},{"line_number":215,"context_line":"        return"},{"line_number":216,"context_line":"    value_list \u003d list(res.values())"},{"line_number":217,"context_line":"    if ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"},{"line_number":218,"context_line":"            isinstance(value_list[0], dict)) and not any(value_list[0]):"},{"line_number":219,"context_line":"            # This judgement processes the res like {\u0027networks\u0027:[{},{}]},"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_bf12d660","line":216,"range":{"start_line":216,"start_character":4,"end_line":216,"end_character":35},"in_reply_to":"ba63e191_909fed5e","updated":"2016-01-20 02:48:19.000000000","message":"Agree.Nice idea.","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9f6812e70aa6a93ec659e2c9afa85013bed6d14f","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        return"},{"line_number":216,"context_line":"    value_list \u003d list(res.values())"},{"line_number":217,"context_line":"    if ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"},{"line_number":218,"context_line":"            isinstance(value_list[0], dict)) and not any(value_list[0]):"},{"line_number":219,"context_line":"            # This judgement processes the res like {\u0027networks\u0027:[{},{}]},"},{"line_number":220,"context_line":"            # {\u0027networks\u0027:[{}]} and {\u0027network\u0027: {}}, the result"},{"line_number":221,"context_line":"            # like this means that there is nothing returned after"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_765832fb","line":218,"updated":"2016-01-19 12:14:43.000000000","message":"This condition is not easy to read.\nConsider adding a line break before \"and not any(value_list[0])\".\n\nI first thought the first line and the second line are OR-ed, but it was wrong....","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"78c69e403d8a709745c2ba5d6db9267e6b04ccea","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        return"},{"line_number":216,"context_line":"    value_list \u003d list(res.values())"},{"line_number":217,"context_line":"    if ((isinstance(value_list[0], list) and len(value_list[0]) \u003e 0) or"},{"line_number":218,"context_line":"            isinstance(value_list[0], dict)) and not any(value_list[0]):"},{"line_number":219,"context_line":"            # This judgement processes the res like {\u0027networks\u0027:[{},{}]},"},{"line_number":220,"context_line":"            # {\u0027networks\u0027:[{}]} and {\u0027network\u0027: {}}, the result"},{"line_number":221,"context_line":"            # like this means that there is nothing returned after"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_e2f675f8","line":218,"in_reply_to":"ba63e191_765832fb","updated":"2016-01-20 02:48:19.000000000","message":"Agree. Maybe I should add more comments to describe this condition. I will update it.","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"32382629a7d69994f64cfd3272c782b9f100cf62","unresolved":false,"context_lines":[{"line_number":216,"context_line":"    # to process the following logical in this function."},{"line_number":217,"context_line":"    # And we should let it pass the res like {\u0027resources\u0027: []} when list"},{"line_number":218,"context_line":"    # resources. It means there is no resource."},{"line_number":219,"context_line":"    if not fields or (not result and isinstance(result, list)):"},{"line_number":220,"context_line":"        return"},{"line_number":221,"context_line":"    if (((isinstance(result, list) and len(result) \u003e 0) or"},{"line_number":222,"context_line":"        isinstance(result, dict)) and"},{"line_number":223,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"9a68dd71_28c115e5","line":220,"range":{"start_line":219,"start_character":4,"end_line":220,"end_character":14},"updated":"2016-01-24 23:54:19.000000000","message":"I think it is worth checked even if \u0027fields\u0027 is empty.\nThis is a util and it is not good to assume many context.\nCould you drop \"if not fields\"?","commit_id":"f420adaaee9c910e494292d6ae4b1508c75e5b99"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1300442985ad2d9b4fbf6e1f3dc902dfaa549b7b","unresolved":false,"context_lines":[{"line_number":216,"context_line":"    # to process the following logical in this function."},{"line_number":217,"context_line":"    # And we should let it pass the res like {\u0027resources\u0027: []} when list"},{"line_number":218,"context_line":"    # resources. It means there is no resource."},{"line_number":219,"context_line":"    if not fields or (not result and isinstance(result, list)):"},{"line_number":220,"context_line":"        return"},{"line_number":221,"context_line":"    if (((isinstance(result, list) and len(result) \u003e 0) or"},{"line_number":222,"context_line":"        isinstance(result, dict)) and"},{"line_number":223,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"9a68dd71_8822d3a1","line":220,"range":{"start_line":219,"start_character":4,"end_line":220,"end_character":14},"in_reply_to":"9a68dd71_28c115e5","updated":"2016-01-25 01:09:29.000000000","message":"Thanks for kind suggestion and detailed explaination, I will drop it.","commit_id":"f420adaaee9c910e494292d6ae4b1508c75e5b99"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"32382629a7d69994f64cfd3272c782b9f100cf62","unresolved":false,"context_lines":[{"line_number":218,"context_line":"    # resources. It means there is no resource."},{"line_number":219,"context_line":"    if not fields or (not result and isinstance(result, list)):"},{"line_number":220,"context_line":"        return"},{"line_number":221,"context_line":"    if (((isinstance(result, list) and len(result) \u003e 0) or"},{"line_number":222,"context_line":"        isinstance(result, dict)) and"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"            not any(result)):"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a68dd71_534bda59","line":221,"range":{"start_line":221,"start_character":39,"end_line":221,"end_character":55},"updated":"2016-01-24 23:54:19.000000000","message":"We already checked a list is empty at L.219, so this is no longer required.\n\nI think we can make L.219-224 simple as follows:\n\n  if isinstance(result, list) and not result:\n      return\n  if not any(result):\n      \u003cL.225-236\u003e","commit_id":"f420adaaee9c910e494292d6ae4b1508c75e5b99"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"1300442985ad2d9b4fbf6e1f3dc902dfaa549b7b","unresolved":false,"context_lines":[{"line_number":218,"context_line":"    # resources. It means there is no resource."},{"line_number":219,"context_line":"    if not fields or (not result and isinstance(result, list)):"},{"line_number":220,"context_line":"        return"},{"line_number":221,"context_line":"    if (((isinstance(result, list) and len(result) \u003e 0) or"},{"line_number":222,"context_line":"        isinstance(result, dict)) and"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"            not any(result)):"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a68dd71_e8334ff4","line":221,"range":{"start_line":221,"start_character":39,"end_line":221,"end_character":55},"in_reply_to":"9a68dd71_534bda59","updated":"2016-01-25 01:09:29.000000000","message":"Thanks very much for your help. I will update it.","commit_id":"f420adaaee9c910e494292d6ae4b1508c75e5b99"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"d949dde7739fcd4d9bd6ad1aac1f6348e2a77310","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        return"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    if not any(result):"},{"line_number":221,"context_line":"        # This condition processes the res like {\u0027networks\u0027:[{},{}]},"},{"line_number":222,"context_line":"        # {\u0027networks\u0027:[{}]} and {\u0027network\u0027: {}}, these results mean"},{"line_number":223,"context_line":"        # that there is nothing returned after the request, and"},{"line_number":224,"context_line":"        # neutron client should not process them and output to users"},{"line_number":225,"context_line":"        # through CLI. So it should raise InvalidResult."},{"line_number":226,"context_line":"        msg \u003d _(\"One or More of the fields %(fields)s specified do not exist, \""},{"line_number":227,"context_line":"                \"%(res_count)s results would have been shown, but all of \""},{"line_number":228,"context_line":"                \"returned results %(results)s to show were empty.\")"}],"source_content_type":"text/x-python","patch_set":31,"id":"5a5ae5dd_8f6a19ed","line":225,"range":{"start_line":221,"start_character":7,"end_line":225,"end_character":56},"updated":"2016-02-05 05:36:26.000000000","message":"This comment says almost same thing as docstring. Looks unnecessary now.","commit_id":"04876676163ccd0e8247c577f1fc46a869f5d8d0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"4266b42b4c3cc58a01298ccd796a77512166c240","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        return"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    if not any(result):"},{"line_number":221,"context_line":"        # This condition processes the res like {\u0027networks\u0027:[{},{}]},"},{"line_number":222,"context_line":"        # {\u0027networks\u0027:[{}]} and {\u0027network\u0027: {}}, these results mean"},{"line_number":223,"context_line":"        # that there is nothing returned after the request, and"},{"line_number":224,"context_line":"        # neutron client should not process them and output to users"},{"line_number":225,"context_line":"        # through CLI. So it should raise InvalidResult."},{"line_number":226,"context_line":"        msg \u003d _(\"One or More of the fields %(fields)s specified do not exist, \""},{"line_number":227,"context_line":"                \"%(res_count)s results would have been shown, but all of \""},{"line_number":228,"context_line":"                \"returned results %(results)s to show were empty.\")"}],"source_content_type":"text/x-python","patch_set":31,"id":"5a5ae5dd_6af0eb67","line":225,"range":{"start_line":221,"start_character":7,"end_line":225,"end_character":56},"in_reply_to":"5a5ae5dd_8f6a19ed","updated":"2016-02-05 06:16:44.000000000","message":"Agree, thanks.","commit_id":"04876676163ccd0e8247c577f1fc46a869f5d8d0"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"d949dde7739fcd4d9bd6ad1aac1f6348e2a77310","unresolved":false,"context_lines":[{"line_number":223,"context_line":"        # that there is nothing returned after the request, and"},{"line_number":224,"context_line":"        # neutron client should not process them and output to users"},{"line_number":225,"context_line":"        # through CLI. So it should raise InvalidResult."},{"line_number":226,"context_line":"        msg \u003d _(\"One or More of the fields %(fields)s specified do not exist, \""},{"line_number":227,"context_line":"                \"%(res_count)s results would have been shown, but all of \""},{"line_number":228,"context_line":"                \"returned results %(results)s to show were empty.\")"},{"line_number":229,"context_line":"        msg \u003d msg % {\u0027fields\u0027: fields,"},{"line_number":230,"context_line":"                     \u0027res_count\u0027: len(result),"},{"line_number":231,"context_line":"                     \u0027results\u0027: res}"}],"source_content_type":"text/x-python","patch_set":31,"id":"5a5ae5dd_8f38d9f0","line":228,"range":{"start_line":226,"start_character":16,"end_line":228,"end_character":66},"updated":"2016-02-05 05:36:26.000000000","message":"Could you make the message simpler?\nAt least \u0027res\u0027 is unnecessary.\n\u0027One or More\u0027 is incorrect.\n\nFor example,\n\n  All requested fields %(fields)s not found.\n  %(res_count)s results are found but there is nothing to show.","commit_id":"04876676163ccd0e8247c577f1fc46a869f5d8d0"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"4266b42b4c3cc58a01298ccd796a77512166c240","unresolved":false,"context_lines":[{"line_number":223,"context_line":"        # that there is nothing returned after the request, and"},{"line_number":224,"context_line":"        # neutron client should not process them and output to users"},{"line_number":225,"context_line":"        # through CLI. So it should raise InvalidResult."},{"line_number":226,"context_line":"        msg \u003d _(\"One or More of the fields %(fields)s specified do not exist, \""},{"line_number":227,"context_line":"                \"%(res_count)s results would have been shown, but all of \""},{"line_number":228,"context_line":"                \"returned results %(results)s to show were empty.\")"},{"line_number":229,"context_line":"        msg \u003d msg % {\u0027fields\u0027: fields,"},{"line_number":230,"context_line":"                     \u0027res_count\u0027: len(result),"},{"line_number":231,"context_line":"                     \u0027results\u0027: res}"}],"source_content_type":"text/x-python","patch_set":31,"id":"5a5ae5dd_2a10b358","line":228,"range":{"start_line":226,"start_character":16,"end_line":228,"end_character":66},"in_reply_to":"5a5ae5dd_8f38d9f0","updated":"2016-02-05 06:16:44.000000000","message":"Agree. Thanks for your suggestion.","commit_id":"04876676163ccd0e8247c577f1fc46a869f5d8d0"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"37c6957a845f1daa0a8a2a0ecc7688268a54bd61","unresolved":false,"context_lines":[{"line_number":232,"context_line":"    \"\"\"Check the result when specified fields."},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    During show/list resource specified non-exist fields, the results"},{"line_number":235,"context_line":"    returned from neutron server are like:"},{"line_number":236,"context_line":"    {\u0027resource\u0027: {}}, {\u0027resources\u0027:[{},{}]}"},{"line_number":237,"context_line":"    The result is meaningless, so this function cares about whether result"},{"line_number":238,"context_line":"    like them, and it should be raised by an InvalidResult exception or not."}],"source_content_type":"text/x-python","patch_set":35,"id":"7af24918_d3716ce2","line":235,"updated":"2016-03-07 05:56:47.000000000","message":":%s/are/is/g","commit_id":"948a279caa98e599ad6e59fe69dfdfb7918cd894"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0f07a2c3e2faabd10f8bd459e53c166135890285","unresolved":false,"context_lines":[{"line_number":232,"context_line":"    \"\"\"Check the result when specified fields."},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    During show/list resource specified non-exist fields, the results"},{"line_number":235,"context_line":"    returned from neutron server are like:"},{"line_number":236,"context_line":"    {\u0027resource\u0027: {}}, {\u0027resources\u0027:[{},{}]}"},{"line_number":237,"context_line":"    The result is meaningless, so this function cares about whether result"},{"line_number":238,"context_line":"    like them, and it should be raised by an InvalidResult exception or not."}],"source_content_type":"text/x-python","patch_set":35,"id":"5aef4532_892b2f82","line":235,"in_reply_to":"7af24918_d3716ce2","updated":"2016-03-08 01:10:59.000000000","message":"Done","commit_id":"948a279caa98e599ad6e59fe69dfdfb7918cd894"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"37c6957a845f1daa0a8a2a0ecc7688268a54bd61","unresolved":false,"context_lines":[{"line_number":235,"context_line":"    returned from neutron server are like:"},{"line_number":236,"context_line":"    {\u0027resource\u0027: {}}, {\u0027resources\u0027:[{},{}]}"},{"line_number":237,"context_line":"    The result is meaningless, so this function cares about whether result"},{"line_number":238,"context_line":"    like them, and it should be raised by an InvalidResult exception or not."},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    :param res: the final result of show/list resource from neutron server,"},{"line_number":241,"context_line":"                and it should a form of {\u0027resource(s)\u0027: \u003cactual value\u003e}."}],"source_content_type":"text/x-python","patch_set":35,"id":"7af24918_137474cd","line":238,"updated":"2016-03-07 05:56:47.000000000","message":":%s/them/this/g","commit_id":"948a279caa98e599ad6e59fe69dfdfb7918cd894"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0f07a2c3e2faabd10f8bd459e53c166135890285","unresolved":false,"context_lines":[{"line_number":235,"context_line":"    returned from neutron server are like:"},{"line_number":236,"context_line":"    {\u0027resource\u0027: {}}, {\u0027resources\u0027:[{},{}]}"},{"line_number":237,"context_line":"    The result is meaningless, so this function cares about whether result"},{"line_number":238,"context_line":"    like them, and it should be raised by an InvalidResult exception or not."},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    :param res: the final result of show/list resource from neutron server,"},{"line_number":241,"context_line":"                and it should a form of {\u0027resource(s)\u0027: \u003cactual value\u003e}."}],"source_content_type":"text/x-python","patch_set":35,"id":"5aef4532_0938bfd2","line":238,"in_reply_to":"7af24918_137474cd","updated":"2016-03-08 01:10:59.000000000","message":"Done","commit_id":"948a279caa98e599ad6e59fe69dfdfb7918cd894"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"37c6957a845f1daa0a8a2a0ecc7688268a54bd61","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        msg \u003d _(\"All requested fields %(fields)s are not found. \""},{"line_number":254,"context_line":"                \"%(res_count)s results are found but there is \""},{"line_number":255,"context_line":"                \"nothing to show.\")"},{"line_number":256,"context_line":"        msg \u003d msg % {\u0027fields\u0027: fields,"},{"line_number":257,"context_line":"                     \u0027res_count\u0027: len(result)}"},{"line_number":258,"context_line":"        raise exceptions.InvalidResult(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":35,"id":"7af24918_73069821","line":256,"updated":"2016-03-07 05:56:47.000000000","message":"I am not sure where we are checking whether any of the input fields are in the result?","commit_id":"948a279caa98e599ad6e59fe69dfdfb7918cd894"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"0f07a2c3e2faabd10f8bd459e53c166135890285","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        msg \u003d _(\"All requested fields %(fields)s are not found. \""},{"line_number":254,"context_line":"                \"%(res_count)s results are found but there is \""},{"line_number":255,"context_line":"                \"nothing to show.\")"},{"line_number":256,"context_line":"        msg \u003d msg % {\u0027fields\u0027: fields,"},{"line_number":257,"context_line":"                     \u0027res_count\u0027: len(result)}"},{"line_number":258,"context_line":"        raise exceptions.InvalidResult(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":35,"id":"5aef4532_a9d38b37","line":256,"in_reply_to":"7af24918_73069821","updated":"2016-03-08 01:10:59.000000000","message":"@vikram, I\u0027m not sure I get your mean. My understood is if there are some fields in the input list.And others are invalid, the result just contain the valid fields, and it won\u0027t raise any exception. So I think we should not check the input fields are in the result, but we will raise exception the result which is not contain any fields.","commit_id":"948a279caa98e599ad6e59fe69dfdfb7918cd894"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9832b1d5eff53282bf36d658cc4f597c3e763768","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        return"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    if not any(result):"},{"line_number":261,"context_line":"        msg \u003d _(\"All requested fields %(fields)s are not found. \""},{"line_number":262,"context_line":"                \"%(res_count)s results are found but there is \""},{"line_number":263,"context_line":"                \"nothing to show.\")"},{"line_number":264,"context_line":"        msg \u003d msg % {\u0027fields\u0027: fields,"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a18252c_655fed72","line":261,"updated":"2016-04-12 15:38:03.000000000","message":"may be it\u0027s clearer if you say \"None of the requested fields %(fields) was found.\"\n\nBut double check with an english native, I\u0027m not. :)","commit_id":"77a5d0cb5da8ca1e01959c591db9bbf4c3711fe0"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9832b1d5eff53282bf36d658cc4f597c3e763768","unresolved":false,"context_lines":[{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    if not any(result):"},{"line_number":261,"context_line":"        msg \u003d _(\"All requested fields %(fields)s are not found. \""},{"line_number":262,"context_line":"                \"%(res_count)s results are found but there is \""},{"line_number":263,"context_line":"                \"nothing to show.\")"},{"line_number":264,"context_line":"        msg \u003d msg % {\u0027fields\u0027: fields,"},{"line_number":265,"context_line":"                     \u0027res_count\u0027: len(result)}"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a18252c_85e8497e","line":262,"updated":"2016-04-12 15:38:03.000000000","message":"are found -\u003e were found","commit_id":"77a5d0cb5da8ca1e01959c591db9bbf4c3711fe0"}],"neutronclient/neutron/v2_0/__init__.py":[{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"c7317ee8067b9fef112bb2edf1239f324c09924d","unresolved":false,"context_lines":[{"line_number":700,"context_line":"                if not mes:"},{"line_number":701,"context_line":"                    i +\u003d 1"},{"line_number":702,"context_line":"            if count \u003d\u003d i:"},{"line_number":703,"context_line":"                info \u003d []"},{"line_number":704,"context_line":"        if not _columns:"},{"line_number":705,"context_line":"            # clean the parsed_args.columns so that cliff will not break"},{"line_number":706,"context_line":"            parsed_args.columns \u003d []"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_ae4cb69e","line":703,"updated":"2015-08-20 02:42:24.000000000","message":"use any() function is better.thanks","commit_id":"42dab3dfa869da7afc63a3849481e73f85ac3b2d"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"3ac9df7b52cfa8f69f2f5ed21492b75ad1779650","unresolved":false,"context_lines":[{"line_number":700,"context_line":"                if not mes:"},{"line_number":701,"context_line":"                    i +\u003d 1"},{"line_number":702,"context_line":"            if count \u003d\u003d i:"},{"line_number":703,"context_line":"                info \u003d []"},{"line_number":704,"context_line":"        if not _columns:"},{"line_number":705,"context_line":"            # clean the parsed_args.columns so that cliff will not break"},{"line_number":706,"context_line":"            parsed_args.columns \u003d []"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_126cc4cc","line":703,"in_reply_to":"fa1b9901_ae4cb69e","updated":"2015-08-20 15:43:25.000000000","message":"Thank you for review.Good suggestion to me!","commit_id":"42dab3dfa869da7afc63a3849481e73f85ac3b2d"}],"neutronclient/tests/unit/test_utils.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"1cc9c928879a2e709baaf93aaf9dcb1c26f881b6","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        self.assertFalse(utils.is_valid_cidr(\u0027wrong_cidr_format\u0027))"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def test_check_result_valid(self):"},{"line_number":118,"context_line":"        ress \u003d [{\u0027resources\u0027: [{}, {}]}, {\u0027resource\u0027: {}}]"},{"line_number":119,"context_line":"        for res in ress:"},{"line_number":120,"context_line":"            self.assertRaises(exceptions.InvalidResult,"},{"line_number":121,"context_line":"                              utils.check_result_valid, res, [\u0027test_fields\u0027])"}],"source_content_type":"text/x-python","patch_set":24,"id":"fa69d971_9ae57d39","line":118,"updated":"2016-01-04 21:33:25.000000000","message":"I think\n\n  [{\u0027resources\u0027: [{}]}\n\nneeds to be tested too.","commit_id":"c4c5f376865d3d52d309059694067783f38dae32"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"994736817ef40af455e951d9cd123245f2de7fc9","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        self.assertFalse(utils.is_valid_cidr(\u0027wrong_cidr_format\u0027))"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def test_check_result_valid(self):"},{"line_number":118,"context_line":"        ress \u003d [{\u0027resources\u0027: [{}, {}]}, {\u0027resource\u0027: {}}]"},{"line_number":119,"context_line":"        for res in ress:"},{"line_number":120,"context_line":"            self.assertRaises(exceptions.InvalidResult,"},{"line_number":121,"context_line":"                              utils.check_result_valid, res, [\u0027test_fields\u0027])"}],"source_content_type":"text/x-python","patch_set":24,"id":"da6ed579_d6566529","line":118,"in_reply_to":"fa69d971_9ae57d39","updated":"2016-01-14 02:49:20.000000000","message":"Done","commit_id":"c4c5f376865d3d52d309059694067783f38dae32"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"b4768a90e361dea3037331d425f94001b4110fa8","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        self.assertFalse(utils.is_valid_cidr(\u0027wrong_cidr_format\u0027))"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def test_check_result_valid(self):"},{"line_number":118,"context_line":"        ress \u003d [{\u0027resources\u0027: [{}, {}]}, {\u0027resource\u0027: {}}]"},{"line_number":119,"context_line":"        for res in ress:"},{"line_number":120,"context_line":"            self.assertRaises(exceptions.InvalidResult,"},{"line_number":121,"context_line":"                              utils.check_result_valid, res, [\u0027test_fields\u0027])"}],"source_content_type":"text/x-python","patch_set":26,"id":"da6ed579_860aed77","line":118,"updated":"2016-01-14 09:29:10.000000000","message":"In your comment in patch set 24, you said \u0027Done\u0027, but it seems there is no change. How about adding:\n\n  {\u0027resources\u0027: [{}]}\n\nto the list.","commit_id":"66347b5319702bf427c3eee98397d5ec8f9b07b7"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9f6812e70aa6a93ec659e2c9afa85013bed6d14f","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        self.assertFalse(utils.is_valid_cidr(\u0027wrong_cidr_format\u0027))"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def test_check_result_valid(self):"},{"line_number":118,"context_line":"        ress \u003d [{\u0027resources\u0027: [{}, {}]}, {\u0027resource\u0027: {}}]"},{"line_number":119,"context_line":"        for res in ress:"},{"line_number":120,"context_line":"            self.assertRaises(exceptions.InvalidResult,"},{"line_number":121,"context_line":"                              utils.check_result_valid, res, [\u0027test_fields\u0027])"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_b590e3ed","line":118,"updated":"2016-01-19 12:14:43.000000000","message":"The test case was reverted.","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"78c69e403d8a709745c2ba5d6db9267e6b04ccea","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        self.assertFalse(utils.is_valid_cidr(\u0027wrong_cidr_format\u0027))"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def test_check_result_valid(self):"},{"line_number":118,"context_line":"        ress \u003d [{\u0027resources\u0027: [{}, {}]}, {\u0027resource\u0027: {}}]"},{"line_number":119,"context_line":"        for res in ress:"},{"line_number":120,"context_line":"            self.assertRaises(exceptions.InvalidResult,"},{"line_number":121,"context_line":"                              utils.check_result_valid, res, [\u0027test_fields\u0027])"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_9fd7d2be","line":118,"in_reply_to":"ba63e191_b590e3ed","updated":"2016-01-20 02:48:19.000000000","message":"OH, this is my mistake. Thanks.","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"9f6812e70aa6a93ec659e2c9afa85013bed6d14f","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        ress \u003d [{\u0027resources\u0027: [{}, {}]}, {\u0027resource\u0027: {}}]"},{"line_number":119,"context_line":"        for res in ress:"},{"line_number":120,"context_line":"            self.assertRaises(exceptions.InvalidResult,"},{"line_number":121,"context_line":"                              utils.check_result_valid, res, [\u0027test_fields\u0027])"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"class ImportClassTestCase(testtools.TestCase):"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_153befec","line":121,"updated":"2016-01-19 12:14:43.000000000","message":"Please add test cases for valid resources.\nWe need to ensure an unintended exception is raised too.\n\nFor example:\n\n    def test_check_result_valid_with_valid_values(self):\n        ress \u003d [{\u0027resources\u0027: [{\u0027foo\u0027: \u0027bar1\u0027}, {\u0027foo\u0027: \u0027bar2\u0027}]},\n                {\u0027resources\u0027: []},\n                {\u0027resource\u0027: {\u0027foo\u0027: \u0027bar\u0027}}]\n        for res in ress:\n            utils.check_result_valid(res, [\u0027test_fields\u0027])","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"78c69e403d8a709745c2ba5d6db9267e6b04ccea","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        ress \u003d [{\u0027resources\u0027: [{}, {}]}, {\u0027resource\u0027: {}}]"},{"line_number":119,"context_line":"        for res in ress:"},{"line_number":120,"context_line":"            self.assertRaises(exceptions.InvalidResult,"},{"line_number":121,"context_line":"                              utils.check_result_valid, res, [\u0027test_fields\u0027])"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"class ImportClassTestCase(testtools.TestCase):"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_7f03fe42","line":121,"in_reply_to":"ba63e191_153befec","updated":"2016-01-20 02:48:19.000000000","message":"Thanks for suggesions , I will fulfill it.","commit_id":"b09f083c541e116c3532282ec8f4124ba036f086"},{"author":{"_account_id":17211,"name":"Brandon Palm","email":"bapalm@us.ibm.com","username":"bapalm"},"change_message_id":"311416ffb2be3b5baf4ac79643f61bacad1c8ea9","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                              utils.check_result_valid, res, [\u0027test_fields\u0027])"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def test_check_result_valid_with_valid_values(self):"},{"line_number":127,"context_line":"        # ress elements explain by its order"},{"line_number":128,"context_line":"        # 1. There are some resources and list with multiple resources"},{"line_number":129,"context_line":"        #    with mutiple exist fields."},{"line_number":130,"context_line":"        # 2. There isn\u0027t any resources and list with multiple resources"}],"source_content_type":"text/x-python","patch_set":32,"id":"5a5ae5dd_a0859107","line":127,"range":{"start_line":127,"start_character":10,"end_line":127,"end_character":44},"updated":"2016-02-05 14:31:46.000000000","message":"1. What is ress?\n2. explained* not explain","commit_id":"b090f0ad34055127e5ab61327436663d8d360c4d"}],"neutronclient/v2_0/client.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"68329cdc397bc7e8cb337406d2330a64b29d070a","unresolved":false,"context_lines":[{"line_number":271,"context_line":"                                      headers\u003dheaders, params\u003dparams)"},{"line_number":272,"context_line":"                if (method \u003d\u003d \u0027GET\u0027"},{"line_number":273,"context_line":"                    and not any(res[six.next(six.iterkeys(res))])"},{"line_number":274,"context_line":"                        and params.get(\u0027fields\u0027, None) is not None):"},{"line_number":275,"context_line":"                    res_count \u003d len(res[six.next(six.iterkeys(res))])"},{"line_number":276,"context_line":"                    fields \u003d params.get(\u0027fields\u0027)"},{"line_number":277,"context_line":"                    if res_count \u003e 1:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a26ad4f_0f6674ed","line":274,"updated":"2015-10-28 13:00:57.000000000","message":"why does the method matter or fields being specified matter? We can always raise an exception if empty result dicts are coming back.","commit_id":"44fd0a1829eedfbb9a476584f757347a99723546"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"2c89d2b0e0917fac0621bc4d5dd19f3005833a62","unresolved":false,"context_lines":[{"line_number":271,"context_line":"                                      headers\u003dheaders, params\u003dparams)"},{"line_number":272,"context_line":"                if (method \u003d\u003d \u0027GET\u0027"},{"line_number":273,"context_line":"                    and not any(res[six.next(six.iterkeys(res))])"},{"line_number":274,"context_line":"                        and params.get(\u0027fields\u0027, None) is not None):"},{"line_number":275,"context_line":"                    res_count \u003d len(res[six.next(six.iterkeys(res))])"},{"line_number":276,"context_line":"                    fields \u003d params.get(\u0027fields\u0027)"},{"line_number":277,"context_line":"                    if res_count \u003e 1:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a26ad4f_feae3597","line":274,"in_reply_to":"1a26ad4f_0f6674ed","updated":"2015-10-29 03:12:26.000000000","message":"Thanks for review. But the error case is just hit when process GET method and input wrong fields option..I\u0027m not sure whether the other methods may hit this error..I know your suggestion, and I will update this patch.","commit_id":"44fd0a1829eedfbb9a476584f757347a99723546"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"956c4cfcaa0731367e88b75ffa650c36a147be0e","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                    if res_count \u003e 1:"},{"line_number":275,"context_line":"                        msg \u003d _(\"%(res_count)s results would have been shown, \""},{"line_number":276,"context_line":"                                \"but all of returned results %(results)s to \""},{"line_number":277,"context_line":"                                \"show were invalid after process method \""},{"line_number":278,"context_line":"                                \"\u0027%(method)s\u0027\")"},{"line_number":279,"context_line":"                        msg \u003d msg % {\u0027res_count\u0027: res_count, \u0027results\u0027: res,"},{"line_number":280,"context_line":"                                     \u0027method\u0027: method}"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_74bfbdfb","line":277,"updated":"2015-11-04 19:21:01.000000000","message":"Please change \u0027invalid\u0027 to \u0027empty\u0027. Invalid sounds like it\u0027s malformed or some other issue.","commit_id":"13bf2bf95a2b1e3bb461065b71eb9289d34f3a85"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"a10a215a84e157623a8c2752fec2e860b2b354de","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                    if res_count \u003e 1:"},{"line_number":275,"context_line":"                        msg \u003d _(\"%(res_count)s results would have been shown, \""},{"line_number":276,"context_line":"                                \"but all of returned results %(results)s to \""},{"line_number":277,"context_line":"                                \"show were invalid after process method \""},{"line_number":278,"context_line":"                                \"\u0027%(method)s\u0027\")"},{"line_number":279,"context_line":"                        msg \u003d msg % {\u0027res_count\u0027: res_count, \u0027results\u0027: res,"},{"line_number":280,"context_line":"                                     \u0027method\u0027: method}"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_c101fe6b","line":277,"in_reply_to":"fa80f949_74bfbdfb","updated":"2015-11-05 01:04:42.000000000","message":"@Kevin Benton， Thanks very much for review. The description of yours make it more accurate. I will update it.","commit_id":"13bf2bf95a2b1e3bb461065b71eb9289d34f3a85"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"14c82e269b41e76bc6ef7f48d4681336bed75a8a","unresolved":false,"context_lines":[{"line_number":269,"context_line":"            try:"},{"line_number":270,"context_line":"                res \u003d self.do_request(method, action, body\u003dbody,"},{"line_number":271,"context_line":"                                      headers\u003dheaders, params\u003dparams)"},{"line_number":272,"context_line":"                if res and not any(res[six.next(six.iterkeys(res))]):"},{"line_number":273,"context_line":"                    res_count \u003d len(res[six.next(six.iterkeys(res))])"},{"line_number":274,"context_line":"                    if res_count \u003e 1:"},{"line_number":275,"context_line":"                        msg \u003d _(\"%(res_count)s results would have been shown, \""}],"source_content_type":"text/x-python","patch_set":12,"id":"da85f559_bf4115ab","line":272,"updated":"2015-11-11 17:23:23.000000000","message":"This code is not easy to read or understand.  Why not help the code reader a little and be less terse in this case?  My counter-example might be a little on the verbose side but at least it is easier to follow and puts less cognitive load on the reviewer.\n\n  if res:\n      # Example:  For {\u0027network\u0027: ...} this returns \u0027network\u0027\n      result_key \u003d six.next(six.iterkeys(res)) # Or, without six: list(res.keys())[0]\n      results \u003d res[result_key]\n      if len(results) \u003e 1 and not any(results):\n          msg \u003d _(\"%(res_count)s results would have been shown, \"\n          \n                  \"but all of returned results %(results)s to \"\n                  \"show were empty after process method \"\n                  \"\u0027%(method)s\u0027\")\n          msg \u003d msg % {\u0027res_count\u0027: len(results), \u0027results\u0027: res,\n                       \u0027method\u0027: method}\n          raise exceptions.InvalidResultError(reason\u003dmsg)\n\nMaybe Kevin can look at your proposed code and know immediately what it does but I don\u0027t think many of the rest of us mere mortals can.  ;)","commit_id":"5e9bf57db61842a45468519879c34be611e9f70d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"64d665d8d21764770e7a0601edf0a9f77ceac8c4","unresolved":false,"context_lines":[{"line_number":269,"context_line":"            try:"},{"line_number":270,"context_line":"                res \u003d self.do_request(method, action, body\u003dbody,"},{"line_number":271,"context_line":"                                      headers\u003dheaders, params\u003dparams)"},{"line_number":272,"context_line":"                if res and not any(res[six.next(six.iterkeys(res))]):"},{"line_number":273,"context_line":"                    res_count \u003d len(res[six.next(six.iterkeys(res))])"},{"line_number":274,"context_line":"                    if res_count \u003e 1:"},{"line_number":275,"context_line":"                        msg \u003d _(\"%(res_count)s results would have been shown, \""}],"source_content_type":"text/x-python","patch_set":12,"id":"da85f559_4a1940d6","line":272,"in_reply_to":"da85f559_2a8abc1b","updated":"2015-11-11 18:54:45.000000000","message":"Even better!","commit_id":"5e9bf57db61842a45468519879c34be611e9f70d"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"06d1a5887ac664dcd173acf518c855ae08ebc433","unresolved":false,"context_lines":[{"line_number":269,"context_line":"            try:"},{"line_number":270,"context_line":"                res \u003d self.do_request(method, action, body\u003dbody,"},{"line_number":271,"context_line":"                                      headers\u003dheaders, params\u003dparams)"},{"line_number":272,"context_line":"                if res and not any(res[six.next(six.iterkeys(res))]):"},{"line_number":273,"context_line":"                    res_count \u003d len(res[six.next(six.iterkeys(res))])"},{"line_number":274,"context_line":"                    if res_count \u003e 1:"},{"line_number":275,"context_line":"                        msg \u003d _(\"%(res_count)s results would have been shown, \""}],"source_content_type":"text/x-python","patch_set":12,"id":"da85f559_25e0a195","line":272,"in_reply_to":"da85f559_4a1940d6","updated":"2015-11-12 01:22:21.000000000","message":"@Carl, @Kevin.\nThanks very much for review. Your suggestions are wonderful. I will update it soon.Thanks again!","commit_id":"5e9bf57db61842a45468519879c34be611e9f70d"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"42e75db2ae26e2c8b6793d3c48145a623a5353e8","unresolved":false,"context_lines":[{"line_number":269,"context_line":"            try:"},{"line_number":270,"context_line":"                res \u003d self.do_request(method, action, body\u003dbody,"},{"line_number":271,"context_line":"                                      headers\u003dheaders, params\u003dparams)"},{"line_number":272,"context_line":"                if res and not any(res[six.next(six.iterkeys(res))]):"},{"line_number":273,"context_line":"                    res_count \u003d len(res[six.next(six.iterkeys(res))])"},{"line_number":274,"context_line":"                    if res_count \u003e 1:"},{"line_number":275,"context_line":"                        msg \u003d _(\"%(res_count)s results would have been shown, \""}],"source_content_type":"text/x-python","patch_set":12,"id":"da85f559_2a8abc1b","line":272,"in_reply_to":"da85f559_bf4115ab","updated":"2015-11-11 18:50:32.000000000","message":"i agree that this is hard to follow without knowing ahead of time what it\u0027s trying to fix. in addition to Carl\u0027s suggestion, we should just dump the call to \u0027next\u0027 as well since it\u0027s not necessary for us to iterate once and only once.\n\nif res:\n    for collection in res.values():\n        if len(collection) \u003e 1 and not any(collection):\n            msg \u003d _(...)\n            raise excep...","commit_id":"5e9bf57db61842a45468519879c34be611e9f70d"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bbc9432264c221632f57dbbbb92e59f243ae98ec","unresolved":false,"context_lines":[{"line_number":268,"context_line":"            try:"},{"line_number":269,"context_line":"                res \u003d self.do_request(method, action, body\u003dbody,"},{"line_number":270,"context_line":"                                      headers\u003dheaders, params\u003dparams)"},{"line_number":271,"context_line":"                if res:"},{"line_number":272,"context_line":"                    # This judgement will process the res like"},{"line_number":273,"context_line":"                    # {\u0027network\u0027:[{},{}]}, the result like this mean that"},{"line_number":274,"context_line":"                    # there is nothing returned after request, and neutron"}],"source_content_type":"text/x-python","patch_set":14,"id":"da85f559_fc43906a","line":271,"updated":"2015-11-14 21:25:53.000000000","message":"I don\u0027t think changing retry_request is a good idea because this method is used for various types of methods: delete, put, get, list.\nThe proposed logic is specific to list(). I think it is better to prepare another method or add a logic to a method-specific function.","commit_id":"046d4bd788ee8cafae343c6be6319a5eb125a296"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"7f3599f404fc73ce3dffd18f221c893ad965121b","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                res \u003d self.do_request(method, action, body\u003dbody,"},{"line_number":270,"context_line":"                                      headers\u003dheaders, params\u003dparams)"},{"line_number":271,"context_line":"                if res:"},{"line_number":272,"context_line":"                    # This judgement will process the res like"},{"line_number":273,"context_line":"                    # {\u0027network\u0027:[{},{}]}, the result like this mean that"},{"line_number":274,"context_line":"                    # there is nothing returned after request, and neutron"},{"line_number":275,"context_line":"                    # client should not process this result and output to"}],"source_content_type":"text/x-python","patch_set":14,"id":"da85f559_c702f509","line":272,"updated":"2015-11-12 03:39:32.000000000","message":"Not sure judgement is the right word here.  I\u0027m not sure what you\u0027re going for with it either.","commit_id":"046d4bd788ee8cafae343c6be6319a5eb125a296"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bbc9432264c221632f57dbbbb92e59f243ae98ec","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                                      headers\u003dheaders, params\u003dparams)"},{"line_number":271,"context_line":"                if res:"},{"line_number":272,"context_line":"                    # This judgement will process the res like"},{"line_number":273,"context_line":"                    # {\u0027network\u0027:[{},{}]}, the result like this mean that"},{"line_number":274,"context_line":"                    # there is nothing returned after request, and neutron"},{"line_number":275,"context_line":"                    # client should not process this result and output to"},{"line_number":276,"context_line":"                    # users through CLI. So when the result like this should"}],"source_content_type":"text/x-python","patch_set":14,"id":"da85f559_7c580057","line":273,"updated":"2015-11-14 21:25:53.000000000","message":"network -\u003e networks","commit_id":"046d4bd788ee8cafae343c6be6319a5eb125a296"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bbc9432264c221632f57dbbbb92e59f243ae98ec","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                    # there is nothing returned after request, and neutron"},{"line_number":275,"context_line":"                    # client should not process this result and output to"},{"line_number":276,"context_line":"                    # users through CLI. So when the result like this should"},{"line_number":277,"context_line":"                    # raise InvalidResultError."},{"line_number":278,"context_line":"                    for collection in res.values():"},{"line_number":279,"context_line":"                        if len(collection) \u003e 1 and not any(collection):"},{"line_number":280,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""}],"source_content_type":"text/x-python","patch_set":14,"id":"da85f559_dc59ec5c","line":277,"updated":"2015-11-14 21:25:53.000000000","message":"*-show commands also have -F option.\nIf non-existing fields are specified in -F of *-show commands, the returned value would be {\u0027network\u0027: {}}. I think it is worth considered.","commit_id":"046d4bd788ee8cafae343c6be6319a5eb125a296"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"64542ec4fc833e22fe76ba6fadb725151278b09f","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                    # there is nothing returned after request, and neutron"},{"line_number":275,"context_line":"                    # client should not process this result and output to"},{"line_number":276,"context_line":"                    # users through CLI. So when the result like this should"},{"line_number":277,"context_line":"                    # raise InvalidResultError."},{"line_number":278,"context_line":"                    for collection in res.values():"},{"line_number":279,"context_line":"                        if len(collection) \u003e 1 and not any(collection):"},{"line_number":280,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""}],"source_content_type":"text/x-python","patch_set":14,"id":"ba8a016a_7c00db01","line":277,"in_reply_to":"da85f559_2e96a74c","updated":"2015-11-18 02:17:24.000000000","message":"@Akihiro Motoki\t, the original thought is that it will raise error when the res is like [{},{}] once, but in the logic now, the result  like that must be GET action and the key must be \u0027resources\u0027, then what this patch want to fix is true. You said is right, the code now will handle all operations. The problem i hit now is where could get the code in. If the retry_request is not, do_request is also the common method. If possible, I still make the code here, but the control logic change to \"if action \u003d\u003d \"GET\" and res:\", then the following logic could process what we want? Could you give some  more appropriate suggesion?","commit_id":"046d4bd788ee8cafae343c6be6319a5eb125a296"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"15a0a0a801c508a590144341ba828ae16cdbb99b","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                    # there is nothing returned after request, and neutron"},{"line_number":275,"context_line":"                    # client should not process this result and output to"},{"line_number":276,"context_line":"                    # users through CLI. So when the result like this should"},{"line_number":277,"context_line":"                    # raise InvalidResultError."},{"line_number":278,"context_line":"                    for collection in res.values():"},{"line_number":279,"context_line":"                        if len(collection) \u003e 1 and not any(collection):"},{"line_number":280,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""}],"source_content_type":"text/x-python","patch_set":14,"id":"da85f559_2e96a74c","line":277,"in_reply_to":"da85f559_af0e1ae3","updated":"2015-11-16 07:54:13.000000000","message":"I know it, but this method is used by not only *-list but also others including *-show. Having a logic specific to *-list looks odd and it can lead to unexpected behaviors to other commands.\n\nIf you change this common method retry_request, this logic should handle all cases.","commit_id":"046d4bd788ee8cafae343c6be6319a5eb125a296"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"a80c68a15117e6adca01874eb192977330faefdc","unresolved":false,"context_lines":[{"line_number":274,"context_line":"                    # there is nothing returned after request, and neutron"},{"line_number":275,"context_line":"                    # client should not process this result and output to"},{"line_number":276,"context_line":"                    # users through CLI. So when the result like this should"},{"line_number":277,"context_line":"                    # raise InvalidResultError."},{"line_number":278,"context_line":"                    for collection in res.values():"},{"line_number":279,"context_line":"                        if len(collection) \u003e 1 and not any(collection):"},{"line_number":280,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""}],"source_content_type":"text/x-python","patch_set":14,"id":"da85f559_af0e1ae3","line":277,"in_reply_to":"da85f559_dc59ec5c","updated":"2015-11-16 02:29:23.000000000","message":"@Akihiro Motoki, the res like that will be process by other logic, and I will return \"need more than 0 values to unpack\".Thanks.","commit_id":"046d4bd788ee8cafae343c6be6319a5eb125a296"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bbc9432264c221632f57dbbbb92e59f243ae98ec","unresolved":false,"context_lines":[{"line_number":276,"context_line":"                    # users through CLI. So when the result like this should"},{"line_number":277,"context_line":"                    # raise InvalidResultError."},{"line_number":278,"context_line":"                    for collection in res.values():"},{"line_number":279,"context_line":"                        if len(collection) \u003e 1 and not any(collection):"},{"line_number":280,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""},{"line_number":281,"context_line":"                                    \"shown, but all of returned results \""},{"line_number":282,"context_line":"                                    \"%(results)s to show were empty after \""}],"source_content_type":"text/x-python","patch_set":14,"id":"da85f559_1c3e94da","line":279,"updated":"2015-11-14 21:25:53.000000000","message":"Why \u003e 1?  There is a case where a retuned list contains only one element.","commit_id":"046d4bd788ee8cafae343c6be6319a5eb125a296"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"a80c68a15117e6adca01874eb192977330faefdc","unresolved":false,"context_lines":[{"line_number":276,"context_line":"                    # users through CLI. So when the result like this should"},{"line_number":277,"context_line":"                    # raise InvalidResultError."},{"line_number":278,"context_line":"                    for collection in res.values():"},{"line_number":279,"context_line":"                        if len(collection) \u003e 1 and not any(collection):"},{"line_number":280,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""},{"line_number":281,"context_line":"                                    \"shown, but all of returned results \""},{"line_number":282,"context_line":"                                    \"%(results)s to show were empty after \""}],"source_content_type":"text/x-python","patch_set":14,"id":"da85f559_2f90ea94","line":279,"in_reply_to":"da85f559_1c3e94da","updated":"2015-11-16 02:29:23.000000000","message":"@Akihiro Motoki,\nThanks for review. As len\u003d\u003d1 had been process neutronclient, It will be showed as no result.But res like {\u0027resources\u0027:[{},{}]} didn\u0027t get the correct process. So the len should be bigger than 1. Thanks.","commit_id":"046d4bd788ee8cafae343c6be6319a5eb125a296"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"15a0a0a801c508a590144341ba828ae16cdbb99b","unresolved":false,"context_lines":[{"line_number":276,"context_line":"                    # users through CLI. So when the result like this should"},{"line_number":277,"context_line":"                    # raise InvalidResultError."},{"line_number":278,"context_line":"                    for collection in res.values():"},{"line_number":279,"context_line":"                        if len(collection) \u003e 1 and not any(collection):"},{"line_number":280,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""},{"line_number":281,"context_line":"                                    \"shown, but all of returned results \""},{"line_number":282,"context_line":"                                    \"%(results)s to show were empty after \""}],"source_content_type":"text/x-python","patch_set":14,"id":"da85f559_4e50cb5e","line":279,"in_reply_to":"da85f559_2f90ea94","updated":"2015-11-16 07:54:13.000000000","message":"Could you elaborate more?\nWhich logic in neutronclient handles len\u003d\u003d1?\nI don\u0027t understand your comment.\nIs there any reason we cannot deal with \"{resource: [{}]}\"?\n\nI don\u0027t see any differences between len\u003d\u003d1 and len\u003e1.\nFor example, http://paste.openstack.org/show/478936/","commit_id":"046d4bd788ee8cafae343c6be6319a5eb125a296"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"64542ec4fc833e22fe76ba6fadb725151278b09f","unresolved":false,"context_lines":[{"line_number":276,"context_line":"                    # users through CLI. So when the result like this should"},{"line_number":277,"context_line":"                    # raise InvalidResultError."},{"line_number":278,"context_line":"                    for collection in res.values():"},{"line_number":279,"context_line":"                        if len(collection) \u003e 1 and not any(collection):"},{"line_number":280,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""},{"line_number":281,"context_line":"                                    \"shown, but all of returned results \""},{"line_number":282,"context_line":"                                    \"%(results)s to show were empty after \""}],"source_content_type":"text/x-python","patch_set":14,"id":"ba8a016a_16108e4d","line":279,"in_reply_to":"da85f559_4e50cb5e","updated":"2015-11-18 02:17:24.000000000","message":"@Akihiro Motoki\t, thanks for nice catch. It is true there is only 1 element in resource list. I miss that. len\u003d\u003d1 should be raise error too.","commit_id":"046d4bd788ee8cafae343c6be6319a5eb125a296"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"e9f6d1fc061696e8dc38172a77fed6989091d0a2","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                             isinstance(collection, dict)) and"},{"line_number":281,"context_line":"                                not any(collection)):"},{"line_number":282,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""},{"line_number":283,"context_line":"                                    \"shown, but all of returned results \""},{"line_number":284,"context_line":"                                    \"%(results)s to show were empty after \""},{"line_number":285,"context_line":"                                    \"process method \u0027%(method)s\u0027\")"},{"line_number":286,"context_line":"                            msg \u003d msg % {\u0027res_count\u0027: len(collection),"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba8a016a_3aad8c88","line":283,"updated":"2015-11-23 15:31:00.000000000","message":"This message indicates that all of the returned results are empty but this loop is raising an exception on the first bad result found.","commit_id":"6c87306122297774d8e69818aad7c41e9f8533ef"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"6e5369593c62879884f4aa45f9b4834ca85883a8","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                             isinstance(collection, dict)) and"},{"line_number":281,"context_line":"                                not any(collection)):"},{"line_number":282,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""},{"line_number":283,"context_line":"                                    \"shown, but all of returned results \""},{"line_number":284,"context_line":"                                    \"%(results)s to show were empty after \""},{"line_number":285,"context_line":"                                    \"process method \u0027%(method)s\u0027\")"},{"line_number":286,"context_line":"                            msg \u003d msg % {\u0027res_count\u0027: len(collection),"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a8ffd7b_4025385a","line":283,"in_reply_to":"9a8ffd7b_02050fc1","updated":"2015-12-01 03:31:52.000000000","message":"@Richard, it\u0027s true the loop is unnecessary. The returned message just is 1 key to 1 value. It will just process the value is OK. I will update it. Thanks.","commit_id":"6c87306122297774d8e69818aad7c41e9f8533ef"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"7508e12e8ffc8156f3396bbb88e1cd1de6687826","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                             isinstance(collection, dict)) and"},{"line_number":281,"context_line":"                                not any(collection)):"},{"line_number":282,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""},{"line_number":283,"context_line":"                                    \"shown, but all of returned results \""},{"line_number":284,"context_line":"                                    \"%(results)s to show were empty after \""},{"line_number":285,"context_line":"                                    \"process method \u0027%(method)s\u0027\")"},{"line_number":286,"context_line":"                            msg \u003d msg % {\u0027res_count\u0027: len(collection),"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a8ffd7b_02050fc1","line":283,"in_reply_to":"9a8ffd7b_831d8e11","updated":"2015-11-24 14:45:01.000000000","message":"Is it possible for one \"collection\" in res.values() to be good and another to be bad/empty?  If not possible, then there isn\u0027t a need for the loop.  If possible, maybe the message should indicate that some and not all results were empty.","commit_id":"6c87306122297774d8e69818aad7c41e9f8533ef"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"fce987e3040613560f796f0e21ec8c5a237625ab","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                             isinstance(collection, dict)) and"},{"line_number":281,"context_line":"                                not any(collection)):"},{"line_number":282,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""},{"line_number":283,"context_line":"                                    \"shown, but all of returned results \""},{"line_number":284,"context_line":"                                    \"%(results)s to show were empty after \""},{"line_number":285,"context_line":"                                    \"process method \u0027%(method)s\u0027\")"},{"line_number":286,"context_line":"                            msg \u003d msg % {\u0027res_count\u0027: len(collection),"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a8ffd7b_831d8e11","line":283,"in_reply_to":"ba8a016a_3aad8c88","updated":"2015-11-24 12:05:43.000000000","message":"@Richard Theis, thanks for review. This is not for the first res. If do_request had returned the info and not raise err, that means the info should be OK.","commit_id":"6c87306122297774d8e69818aad7c41e9f8533ef"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"f81eb730b8a4d6f4008a2fa8c1411baa24e075c1","unresolved":false,"context_lines":[{"line_number":284,"context_line":"                            msg \u003d msg % {\u0027res_count\u0027: len(collection),"},{"line_number":285,"context_line":"                                         \u0027results\u0027: res,"},{"line_number":286,"context_line":"                                         \u0027method\u0027: method}"},{"line_number":287,"context_line":"                        raise exceptions.InvalidResultError(reason\u003dmsg)"},{"line_number":288,"context_line":"                return res"},{"line_number":289,"context_line":"            except exceptions.ConnectionFailed:"},{"line_number":290,"context_line":"                # Exception has already been logged by do_request()"}],"source_content_type":"text/x-python","patch_set":18,"id":"9a8ffd7b_30e066cc","line":287,"updated":"2015-12-01 13:27:06.000000000","message":"msg may not be set here","commit_id":"6478919ede13f3639c82d7de7c51889d45830515"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"4fa1e0a8f24c0390f50bab44837cf3b57f39ad53","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        \"\"\""},{"line_number":239,"context_line":"        max_attempts \u003d self.retries + 1"},{"line_number":240,"context_line":"        for i in range(max_attempts):"},{"line_number":241,"context_line":"            try:"},{"line_number":242,"context_line":"                res \u003d self.do_request(method, action, body\u003dbody,"},{"line_number":243,"context_line":"                                      headers\u003dheaders, params\u003dparams)"},{"line_number":244,"context_line":"                if method \u003d\u003d \"GET\" and res:"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a710552_78cb11a6","line":241,"updated":"2015-12-16 08:15:44.000000000","message":"I still think it is not a good idea to touch retry_request directly.\nThis method should do only common things.\n\n(1) Can you move the added logic a separate method and call it in get()?\n\n(2) In addition, I think having this logic in the API level can be fragile.\nFor example, when we enable a pagination the response will as follows.\nIt works even in a case of pagination, but we cannot know whether we have\nmore variations.\n\n{\"ports_links\": [{\"href\": \"http://172.16.18.46:9696/v2.0/ports.json?fields\u003dfoo\u0026limit\u003d2\u0026marker\u003dad662e3f-1fc9-4d2d-a74e-01f2e02621f7\", \"rel\": \"next\"}, {\"href\": \"http://172.16.18.46:9696/v2.0/ports.json?fields\u003dfoo\u0026limit\u003d2\u0026marker\u003d994f3389-9159-42e2-a35f-10041bc3b560\u0026page_reverse\u003dTrue\", \"rel\": \"previous\"}], \"ports\": [{}, {}]}\n\nI would suggest not to change do_request itself.\nInstead, we should do this kind of things after we get some final result,\ni.e., a returned value from list() or get().\n(Note that get() is used inside list()...)\n\n\n(3) I also have a basic question.\nI wonder which layer should raise the exception, CLI layer or library layer.\nIt is good to raise some exception as proposed in this patch.\nDo you believe it is useful for library users too?","commit_id":"423ca1bf48f9e905818cb59842ffe8267b02704f"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"e46076fda5073f66221a27e0808debf691dc8892","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        \"\"\""},{"line_number":239,"context_line":"        max_attempts \u003d self.retries + 1"},{"line_number":240,"context_line":"        for i in range(max_attempts):"},{"line_number":241,"context_line":"            try:"},{"line_number":242,"context_line":"                res \u003d self.do_request(method, action, body\u003dbody,"},{"line_number":243,"context_line":"                                      headers\u003dheaders, params\u003dparams)"},{"line_number":244,"context_line":"                if method \u003d\u003d \"GET\" and res:"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a7e1126_c5fcdc40","line":241,"in_reply_to":"5a710552_78cb11a6","updated":"2015-12-17 09:25:19.000000000","message":"Thanks very much for your suggestions. It may get the final result in get_data of NeutronCommand in neutronV20. Even if request the pagination list, it will get the result and raise the exception. In my test, the result like {\u0027resource\u0027: {}}, there isn\u0027t a logic to process this view. So my thought is add the current logic to utils and make it use for List and Get request, may I ? \nFor the 3rd, the RestAPI may return the actual result like {\u0027resource\u0027: [{},{}]}, I think this is OK. I fix this is for display of neutronclient. So I think CLI layer is OK. Please feel free to correct.","commit_id":"423ca1bf48f9e905818cb59842ffe8267b02704f"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"1b31489164c7efb10e4eff6856451db0ea725d55","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                    # client should not process this result and output to"},{"line_number":249,"context_line":"                    # users through CLI. So when the result like this should"},{"line_number":250,"context_line":"                    # raise InvalidResultError."},{"line_number":251,"context_line":"                    for collection in res.values():"},{"line_number":252,"context_line":"                        if len(collection) \u003e 1 and not any(collection):"},{"line_number":253,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""},{"line_number":254,"context_line":"                                    \"shown, but all of returned results \""}],"source_content_type":"text/x-python","patch_set":20,"id":"5a710552_ce638db0","line":251,"updated":"2015-12-15 13:50:27.000000000","message":"In patch set 16, you indicated that the loop is not necessary.  So I\u0027m still unclear on why an error is raised if there is a collection of results where one or more may be good.","commit_id":"423ca1bf48f9e905818cb59842ffe8267b02704f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"4fa1e0a8f24c0390f50bab44837cf3b57f39ad53","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""},{"line_number":254,"context_line":"                                    \"shown, but all of returned results \""},{"line_number":255,"context_line":"                                    \"%(results)s to show were empty after \""},{"line_number":256,"context_line":"                                    \"process method \u0027%(method)s\u0027\")"},{"line_number":257,"context_line":"                            msg \u003d msg % {\u0027res_count\u0027: len(collection),"},{"line_number":258,"context_line":"                                         \u0027results\u0027: res,"},{"line_number":259,"context_line":"                                         \u0027method\u0027: method}"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a710552_3874a966","line":256,"updated":"2015-12-16 08:15:44.000000000","message":"it would be nice if the message mentions a typical cause (in this case non-existing field).","commit_id":"423ca1bf48f9e905818cb59842ffe8267b02704f"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"e46076fda5073f66221a27e0808debf691dc8892","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                            msg \u003d _(\"%(res_count)s results would have been \""},{"line_number":254,"context_line":"                                    \"shown, but all of returned results \""},{"line_number":255,"context_line":"                                    \"%(results)s to show were empty after \""},{"line_number":256,"context_line":"                                    \"process method \u0027%(method)s\u0027\")"},{"line_number":257,"context_line":"                            msg \u003d msg % {\u0027res_count\u0027: len(collection),"},{"line_number":258,"context_line":"                                         \u0027results\u0027: res,"},{"line_number":259,"context_line":"                                         \u0027method\u0027: method}"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a7e1126_a51d1075","line":256,"in_reply_to":"5a710552_3874a966","updated":"2015-12-17 09:25:19.000000000","message":"Thanks. I will update it.","commit_id":"423ca1bf48f9e905818cb59842ffe8267b02704f"}]}
