)]}'
{"ironic/common/exception.py":[{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"d0ac085209820f034263f63797ddd4339627ac38","unresolved":false,"context_lines":[{"line_number":171,"context_line":"    message \u003d _(\"Invalid resource state.\")"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"class MACExists(Conflict):"},{"line_number":175,"context_line":"    message \u003d _(\"MAC address %(mac)s already exists.\")"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F947o%3D","line":174,"updated":"2013-12-04 20:24:58.000000000","message":"I feel that this exception class name is not descriptive enough, and would prefer eg. MACAlreadyExists or DuplicateMACError or DuplicatePort or some such. I think this will make the code slightly more readable, eg,\n\n  except DBDuplicateError:\n    raise exception.DuplicateMACError(mac\u003dport[\u0027address\u0027])\n\nI would also clarify the message slightly, eg. \"A Port with MAC address (mac)s already exists.\"","commit_id":"9661026977152d58ba7847c1e9d5fb0e3a2e2a64"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"e844298cbe3cda9ce3ceccdf2fa985292e48d4d4","unresolved":false,"context_lines":[{"line_number":171,"context_line":"    message \u003d _(\"Invalid resource state.\")"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"class MACExists(Conflict):"},{"line_number":175,"context_line":"    message \u003d _(\"MAC address %(mac)s already exists.\")"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F92OE%3D","line":174,"in_reply_to":"AAAATn%2F947o%3D","updated":"2013-12-05 09:46:32.000000000","message":"I agree, I think MACAlreadyExists is pretty clear, and match better with the message. I will change it, also I\u0027ll pay more attention when naming things (I always struggle with it).\n\nThanks for pointing it out and for the suggestions","commit_id":"9661026977152d58ba7847c1e9d5fb0e3a2e2a64"}],"ironic/db/sqlalchemy/api.py":[{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"3ce1619bd654698330726d00e23a079e46d1cca8","unresolved":false,"context_lines":[{"line_number":397,"context_line":"                query \u003d add_port_filter(query, port_id)"},{"line_number":398,"context_line":"                try:"},{"line_number":399,"context_line":"                    ref \u003d query.one()"},{"line_number":400,"context_line":"                except NoResultFound:"},{"line_number":401,"context_line":"                    raise exception.PortNotFound(port\u003dport_id)"},{"line_number":402,"context_line":"                _check_port_change_forbidden(ref, session)"},{"line_number":403,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F96xw%3D","line":400,"updated":"2013-12-04 14:20:46.000000000","message":"maybe to move this except outsinde \u0027with\u0027, currently it\u0027s too much nested try/with","commit_id":"7656d51cff26c02a0f6c9ba8b3c9a177a9384b1c"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"9f0de5d3ac4e12270438e1b391da1f1e3ed76060","unresolved":false,"context_lines":[{"line_number":397,"context_line":"                query \u003d add_port_filter(query, port_id)"},{"line_number":398,"context_line":"                try:"},{"line_number":399,"context_line":"                    ref \u003d query.one()"},{"line_number":400,"context_line":"                except NoResultFound:"},{"line_number":401,"context_line":"                    raise exception.PortNotFound(port\u003dport_id)"},{"line_number":402,"context_line":"                _check_port_change_forbidden(ref, session)"},{"line_number":403,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F96K0%3D","line":400,"in_reply_to":"AAAATn%2F96xw%3D","updated":"2013-12-04 16:19:02.000000000","message":"+1, will do that, thank you :)","commit_id":"7656d51cff26c02a0f6c9ba8b3c9a177a9384b1c"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"3ce1619bd654698330726d00e23a079e46d1cca8","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                _check_port_change_forbidden(ref, session)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"                ref.update(values)"},{"line_number":405,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":406,"context_line":"            raise exception.MACExists(mac\u003dvalues[\u0027address\u0027])"},{"line_number":407,"context_line":"        return ref"},{"line_number":408,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F96xM%3D","line":405,"updated":"2013-12-04 14:20:46.000000000","message":"another option is to move everything inside inner try, call session.flush() (to force DB constraints) in the end of those try and catch this exception there too","commit_id":"7656d51cff26c02a0f6c9ba8b3c9a177a9384b1c"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"9f0de5d3ac4e12270438e1b391da1f1e3ed76060","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                _check_port_change_forbidden(ref, session)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"                ref.update(values)"},{"line_number":405,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":406,"context_line":"            raise exception.MACExists(mac\u003dvalues[\u0027address\u0027])"},{"line_number":407,"context_line":"        return ref"},{"line_number":408,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F96KM%3D","line":405,"in_reply_to":"AAAATn%2F96xM%3D","updated":"2013-12-04 16:19:02.000000000","message":"Yea I tested both here just to see how it looks like, I think the first option looks a bit better, if we call flush() we also will want to add a NOTE explaining why and so on, so I think the first case looks a better :)\n\nThanks for idea!","commit_id":"7656d51cff26c02a0f6c9ba8b3c9a177a9384b1c"}],"ironic/tests/api/test_ports.py":[{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"82b922de40a026758c544fe63434029a0631fe53","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        self.assertEqual(response.status_int, 409)"},{"line_number":390,"context_line":"        self.assertEqual(response.content_type, \u0027application/json\u0027)"},{"line_number":391,"context_line":"        self.assertTrue(response.json[\u0027error_message\u0027])"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"class TestDelete(base.FunctionalTest):"},{"line_number":395,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9s%2BU%3D","line":392,"updated":"2013-12-06 23:08:38.000000000","message":"Lucas, I think this is same comment with another onoe - how do you think can we add more case to test if our code can handle the existing address with different capital/lowercase?","commit_id":"bff81205a337f3347433071e804e16290521c08f"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"c6733ef9414062de0137b3470d93a6ac9bb795d5","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        self.assertEqual(response.status_int, 409)"},{"line_number":390,"context_line":"        self.assertEqual(response.content_type, \u0027application/json\u0027)"},{"line_number":391,"context_line":"        self.assertTrue(response.json[\u0027error_message\u0027])"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"class TestDelete(base.FunctionalTest):"},{"line_number":395,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9iak%3D","line":392,"in_reply_to":"AAAATn%2F9m2c%3D","updated":"2013-12-10 13:36:19.000000000","message":"Thank you Lucas:)","commit_id":"bff81205a337f3347433071e804e16290521c08f"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b239d20ee89a9f79c1437446ff37992578b12cc3","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        self.assertEqual(response.status_int, 409)"},{"line_number":390,"context_line":"        self.assertEqual(response.content_type, \u0027application/json\u0027)"},{"line_number":391,"context_line":"        self.assertTrue(response.json[\u0027error_message\u0027])"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"class TestDelete(base.FunctionalTest):"},{"line_number":395,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9m2c%3D","line":392,"in_reply_to":"AAAATn%2F9s%2BU%3D","updated":"2013-12-09 18:15:22.000000000","message":"Hi Haomeng, I addressed this problem in another patch: https://review.openstack.org/60890\n\nThanks for pointing that out :)","commit_id":"bff81205a337f3347433071e804e16290521c08f"}]}
