)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"07b457cc9217ce401de99f9372ff58764965e960","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Allen \u003cchen.qiaomin@99cloud.net\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-25 07:21:31 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Modification on name repeated error message of admin create volume type"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When input a volume type name that already exist, we will see the error"},{"line_number":10,"context_line":"message on the top right corner of the volume type page. Also, the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"fa1b9901_0fdcebe2","line":7,"updated":"2015-08-25 09:04:51.000000000","message":"The first line of commit message should be limited to 50 characters.\nref: https://wiki.openstack.org/wiki/GitCommitMessages#Summary_of_Git_commit_message_structure","commit_id":"7ccdeaf3e22d0eb387c4ba4401c3a79a051005c1"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"d066cf67727f34f568a3b349288cce4ba490015e","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     chenqiaomin \u003cchen.qiaomin@99cloud.net\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-07-08 09:17:26 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Give distinct error message on admin create volume type"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When input a volume type name that already exist, we will see the"},{"line_number":10,"context_line":"error message: \"Unable to create volume type\", this error message"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa1b9901_b51bd07f","line":7,"updated":"2015-08-25 09:45:13.000000000","message":"The commit message title is still \u003e 50 characters. Would be better to use\n\nImprove error message for create volume type\n\nAnd all the other required details you can add in below description.","commit_id":"5bcb108aeaa8f5ea2df8debe3515ad9f6c978261"},{"author":{"_account_id":9317,"name":"Ana Krivokapic","email":"akrivoka@redhat.com","username":"akrivoka"},"change_message_id":"161385c1a7bf8533268af0cb93f66ee1d640b324","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When input a volume type name that already exist, we will see the"},{"line_number":10,"context_line":"error message: \"Unable to create volume type\", this error message"},{"line_number":11,"context_line":"is not specific and clear. If provide specific and clear error"},{"line_number":12,"context_line":"message: \u0027The name is already in use\u0027, it will be more better."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I4b62fd51d33c5ca36685d1109bba0aed0fd50a05"},{"line_number":15,"context_line":"Closes-Bug: #1487658"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"da20952f_66a07291","line":12,"updated":"2015-09-02 09:45:18.000000000","message":"The commit message doesn\u0027t match the code - you\u0027re not using the string  \u0027The name is already in use\u0027 anywhere.","commit_id":"da2273c09747001ef29eb814100a9b2ed873fa92"}],"openstack_dashboard/dashboards/admin/volumes/volumes/forms.py":[{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"07b457cc9217ce401de99f9372ff58764965e960","unresolved":false,"context_lines":[{"line_number":226,"context_line":"            messages.success(request, _(\u0027Successfully created volume type: %s\u0027)"},{"line_number":227,"context_line":"                             % data[\u0027name\u0027])"},{"line_number":228,"context_line":"            return volume_type"},{"line_number":229,"context_line":"        except Exception as e:"},{"line_number":230,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":231,"context_line":"                error_msg \u003d _(\"The name is already in use.\")"},{"line_number":232,"context_line":"                self._errors[\u0027name\u0027] \u003d self.error_class([error_msg])"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa1b9901_ef4417b8","line":229,"updated":"2015-08-25 09:04:51.000000000","message":"Why just not to define specific error message if name is already in use and keep rest of the code as it is.\n\nexcept Exception as exc:\n    if exc.status_code \u003d\u003d 409:\n        msg \u003d _(\u0027The volume type name is already in use.\u0027)\n    else:\n        msg \u003d _(\u0027Unable to create volume type.\u0027)\n    redirect \u003d reverse(\"horizon:admin:volumes:index\")\n    exceptions.handle(request, msg, redirect\u003dredirect)","commit_id":"7ccdeaf3e22d0eb387c4ba4401c3a79a051005c1"},{"author":{"_account_id":15168,"name":"Kirill Zaitsev","email":"k.zaitsev@me.com","username":"kzaitsev"},"change_message_id":"a99af3c8f711110de0093c0d6631eff366698b43","unresolved":false,"context_lines":[{"line_number":226,"context_line":"            messages.success(request, _(\u0027Successfully created volume type: %s\u0027)"},{"line_number":227,"context_line":"                             % data[\u0027name\u0027])"},{"line_number":228,"context_line":"            return volume_type"},{"line_number":229,"context_line":"        except Exception as e:"},{"line_number":230,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":231,"context_line":"                error_msg \u003d _(\"The name is already in use.\")"},{"line_number":232,"context_line":"                redirect \u003d reverse(\"horizon:admin:volumes:index\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_e02f4486","line":229,"updated":"2015-08-25 09:45:37.000000000","message":"can we maybe catch ClientException here? https://github.com/openstack/python-cinderclient/blob/master/cinderclient/exceptions.py#L79\n\nAt the very least current code has 2 except Exception, which means 2d one would not be executed. if we can\u0027t catch a specific exception here — you should at least combine the 2 except statements into 1","commit_id":"5bcb108aeaa8f5ea2df8debe3515ad9f6c978261"},{"author":{"_account_id":14151,"name":"ziyu032","email":"chen.qiaomin@99cloud.net","username":"ziyu032"},"change_message_id":"db3ffd489b3dde89a4c1d68cf6b7b367dbd24229","unresolved":false,"context_lines":[{"line_number":226,"context_line":"            messages.success(request, _(\u0027Successfully created volume type: %s\u0027)"},{"line_number":227,"context_line":"                             % data[\u0027name\u0027])"},{"line_number":228,"context_line":"            return volume_type"},{"line_number":229,"context_line":"        except Exception as e:"},{"line_number":230,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":231,"context_line":"                error_msg \u003d _(\"The name is already in use.\")"},{"line_number":232,"context_line":"                redirect \u003d reverse(\"horizon:admin:volumes:index\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_e3e2b9d4","line":229,"in_reply_to":"fa1b9901_00a4b8a3","updated":"2015-08-26 07:45:08.000000000","message":"There can not catch the \"Conflict(HTTPClientError)\", only can catch the \u0027cinderclient.exceptions.ClientException\u0027.","commit_id":"5bcb108aeaa8f5ea2df8debe3515ad9f6c978261"},{"author":{"_account_id":15168,"name":"Kirill Zaitsev","email":"k.zaitsev@me.com","username":"kzaitsev"},"change_message_id":"d01abd869e39840e7a94c360442a02fe4a7cc9bb","unresolved":false,"context_lines":[{"line_number":226,"context_line":"            messages.success(request, _(\u0027Successfully created volume type: %s\u0027)"},{"line_number":227,"context_line":"                             % data[\u0027name\u0027])"},{"line_number":228,"context_line":"            return volume_type"},{"line_number":229,"context_line":"        except Exception as e:"},{"line_number":230,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":231,"context_line":"                error_msg \u003d _(\"The name is already in use.\")"},{"line_number":232,"context_line":"                redirect \u003d reverse(\"horizon:admin:volumes:index\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_00a4b8a3","line":229,"in_reply_to":"fa1b9901_e02f4486","updated":"2015-08-25 09:53:10.000000000","message":"or maybe https://github.com/openstack/python-cinderclient/blob/master/cinderclient/openstack/common/apiclient/exceptions.py#L233 this exception is more appropriate?","commit_id":"5bcb108aeaa8f5ea2df8debe3515ad9f6c978261"},{"author":{"_account_id":9647,"name":"Justin Pomeroy","email":"jpomero@linux.vnet.ibm.com","username":"jpomero"},"change_message_id":"7dfc7f5381a2f297bfbe7ceffc6da0c5497ec3cb","unresolved":false,"context_lines":[{"line_number":226,"context_line":"            messages.success(request, _(\u0027Successfully created volume type: %s\u0027)"},{"line_number":227,"context_line":"                             % data[\u0027name\u0027])"},{"line_number":228,"context_line":"            return volume_type"},{"line_number":229,"context_line":"        except Exception as e:"},{"line_number":230,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":231,"context_line":"                error_msg \u003d _(\"The name is already in use.\")"},{"line_number":232,"context_line":"                redirect \u003d reverse(\"horizon:admin:volumes:index\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_eeacd589","line":229,"in_reply_to":"fa1b9901_e3e2b9d4","updated":"2015-08-26 11:54:41.000000000","message":"That is because the horizon cinder API does not make use of the Conflict type when creating a new volume type.  I think that should be changed.  See how it\u0027s done when creating a user:\n\nhttps://github.com/openstack/horizon/blob/master/openstack_dashboard/api/keystone.py#L334","commit_id":"5bcb108aeaa8f5ea2df8debe3515ad9f6c978261"},{"author":{"_account_id":14151,"name":"ziyu032","email":"chen.qiaomin@99cloud.net","username":"ziyu032"},"change_message_id":"6e8e8fc79be0c54f3c2ad2dc4edcfa5d953f7732","unresolved":false,"context_lines":[{"line_number":226,"context_line":"            messages.success(request, _(\u0027Successfully created volume type: %s\u0027)"},{"line_number":227,"context_line":"                             % data[\u0027name\u0027])"},{"line_number":228,"context_line":"            return volume_type"},{"line_number":229,"context_line":"        except Exception as e:"},{"line_number":230,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":231,"context_line":"                error_msg \u003d _(\"The name is already in use.\")"},{"line_number":232,"context_line":"                redirect \u003d reverse(\"horizon:admin:volumes:index\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_bea12c96","line":229,"in_reply_to":"fa1b9901_eeacd589","updated":"2015-08-26 13:11:52.000000000","message":"keystone api can return Conflict because keystoneclient  give \"keystoneclient.openstack.common.apiclient.exceptions.Conflict\" exception, but cinderclient not give this type exception, while only the \"cinderclient.exceptions.ClientException\", so we can not cast horizon Conflict from cinder api.","commit_id":"5bcb108aeaa8f5ea2df8debe3515ad9f6c978261"},{"author":{"_account_id":10485,"name":"Ankit Agrawal","email":"ankitagrawal8188@gmail.com","username":"ankitagrawal"},"change_message_id":"d066cf67727f34f568a3b349288cce4ba490015e","unresolved":false,"context_lines":[{"line_number":229,"context_line":"        except Exception as e:"},{"line_number":230,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":231,"context_line":"                error_msg \u003d _(\"The name is already in use.\")"},{"line_number":232,"context_line":"                redirect \u003d reverse(\"horizon:admin:volumes:index\")"},{"line_number":233,"context_line":"                exceptions.handle(request, error_msg, redirect\u003dredirect)"},{"line_number":234,"context_line":"        except Exception:"},{"line_number":235,"context_line":"            redirect \u003d reverse(\"horizon:admin:volumes:index\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_555a7484","line":232,"updated":"2015-08-25 09:45:13.000000000","message":"Allen, This is a duplicate code for both the exception blocks. The source code I have suggested in previous review, will eliminate this code duplication. There is no need to define two exception block in this case. Just use\n\nexcept Exception as exc:\n    if exc.status_code \u003d\u003d 409:\n        msg \u003d _(\u0027The volume type name is already in use.\u0027)\n    else:\n        msg \u003d _(\u0027Unable to create volume type.\u0027)\n    redirect \u003d reverse(\"horizon:admin:volumes:index\")\n    exceptions.handle(request, msg, redirect\u003dredirect)","commit_id":"5bcb108aeaa8f5ea2df8debe3515ad9f6c978261"},{"author":{"_account_id":9647,"name":"Justin Pomeroy","email":"jpomero@linux.vnet.ibm.com","username":"jpomero"},"change_message_id":"3eaea7f1238b7cdf83bcdbb2b5e15b9616326497","unresolved":false,"context_lines":[{"line_number":228,"context_line":"            return volume_type"},{"line_number":229,"context_line":"        except Exception as e:"},{"line_number":230,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":231,"context_line":"                error_msg \u003d _(\"The name is already in use.\")"},{"line_number":232,"context_line":"            else:"},{"line_number":233,"context_line":"                error_msg \u003d _(\u0027Unable to create volume type.\u0027)"},{"line_number":234,"context_line":"            redirect \u003d reverse(\"horizon:admin:volumes:index\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_fb6c2b38","line":231,"updated":"2015-09-02 02:19:10.000000000","message":"I think it would be better to show a field level error message.  This way the form also stays open so the user can change the name and resubmit.\n\n    self.add_error(\u0027name\u0027, _(\"The name is already in use.\"))","commit_id":"29b92401b1b94e22227e8314d67c12379f0e1923"},{"author":{"_account_id":9647,"name":"Justin Pomeroy","email":"jpomero@linux.vnet.ibm.com","username":"jpomero"},"change_message_id":"3eaea7f1238b7cdf83bcdbb2b5e15b9616326497","unresolved":false,"context_lines":[{"line_number":232,"context_line":"            else:"},{"line_number":233,"context_line":"                error_msg \u003d _(\u0027Unable to create volume type.\u0027)"},{"line_number":234,"context_line":"            redirect \u003d reverse(\"horizon:admin:volumes:index\")"},{"line_number":235,"context_line":"            exceptions.handle(request, error_msg, redirect\u003dredirect)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"class UpdateStatus(forms.SelfHandlingForm):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_fb018b3a","line":235,"updated":"2015-09-02 02:19:10.000000000","message":"If a field level error message is added then the exceptions.handle() only needs to happen in the else block.","commit_id":"29b92401b1b94e22227e8314d67c12379f0e1923"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"172875d43db5cf15d4d190cb04e776d034c1ad2b","unresolved":false,"context_lines":[{"line_number":243,"context_line":"            return volume_type"},{"line_number":244,"context_line":"        except Exception as e:"},{"line_number":245,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":246,"context_line":"                error_msg \u003d _(\"The name is already in use.\")"},{"line_number":247,"context_line":"                self._errors[\u0027name\u0027] \u003d self.error_class([error_msg])"},{"line_number":248,"context_line":"        except Exception:"},{"line_number":249,"context_line":"            redirect \u003d reverse(\"horizon:admin:volumes:index\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_c1e1319c","line":246,"updated":"2015-09-02 06:46:29.000000000","message":"sugesstion: it\u0027s better to keep consistent with the exception error message  \u0027Volume Type %(name)s already exists\u0027 .","commit_id":"603943d2c65dc14c6fc77904959c18fcb353b857"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"172875d43db5cf15d4d190cb04e776d034c1ad2b","unresolved":false,"context_lines":[{"line_number":245,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":246,"context_line":"                error_msg \u003d _(\"The name is already in use.\")"},{"line_number":247,"context_line":"                self._errors[\u0027name\u0027] \u003d self.error_class([error_msg])"},{"line_number":248,"context_line":"        except Exception:"},{"line_number":249,"context_line":"            redirect \u003d reverse(\"horizon:admin:volumes:index\")"},{"line_number":250,"context_line":"            exceptions.handle(request,"},{"line_number":251,"context_line":"                              _(\u0027Unable to create volume type.\u0027),"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_61170555","line":248,"updated":"2015-09-02 06:46:29.000000000","message":"I don\u0027t think this can work by catching the exception again, why not using if/else as the previous patch set.","commit_id":"603943d2c65dc14c6fc77904959c18fcb353b857"},{"author":{"_account_id":16769,"name":"Lucas Palm","email":"lapalm@us.ibm.com","username":"lucaspalm"},"change_message_id":"73e768f84fa785f444786a282b3403cd915c93b3","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        except Exception as e:"},{"line_number":245,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":246,"context_line":"                msg \u003d _(\u0027Volume type name \"%s\" already \u0027"},{"line_number":247,"context_line":"                        \u0027exists.\u0027) % (data[\u0027name\u0027])"},{"line_number":248,"context_line":"                self._errors[\u0027name\u0027] \u003d self.error_class([msg])"},{"line_number":249,"context_line":"            else:"},{"line_number":250,"context_line":"                redirect \u003d reverse(\"horizon:admin:volumes:index\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_241264b5","line":247,"updated":"2015-09-02 15:42:26.000000000","message":"Should your error message match the format of the message on line 241?\n\n(e.g. \u0027This volume type name already exists: %s\u0027)\n\nJust a thought, not a big deal...","commit_id":"da2273c09747001ef29eb814100a9b2ed873fa92"},{"author":{"_account_id":6914,"name":"Tatiana Ovchinnikova","email":"t.v.ovtchinnikova@gmail.com","username":"tmazur"},"change_message_id":"c22eba13a35ecf08f65839ab40ee3ddb57aa5eb6","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        except Exception as e:"},{"line_number":245,"context_line":"            if getattr(e, \u0027code\u0027, None) \u003d\u003d 409:"},{"line_number":246,"context_line":"                msg \u003d _(\u0027Volume type name \"%s\" already \u0027"},{"line_number":247,"context_line":"                        \u0027exists.\u0027) % (data[\u0027name\u0027])"},{"line_number":248,"context_line":"                self._errors[\u0027name\u0027] \u003d self.error_class([msg])"},{"line_number":249,"context_line":"            else:"},{"line_number":250,"context_line":"                redirect \u003d reverse(\"horizon:admin:volumes:index\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_805505c3","line":247,"updated":"2015-09-04 08:40:41.000000000","message":"Please remove unnecessary parentheses around data[\u0027name\u0027].","commit_id":"0dc10c79c2dbe8b9901e3b172208b9ea0496b790"}]}
