)]}'
{"neutron/services/segments/db.py":[{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"967872dd76f22876a6b49faf411f4f5b0d22da53","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            new_segment \u003d db.NetworkSegment(**args)"},{"line_number":105,"context_line":"            try:"},{"line_number":106,"context_line":"                context.session.add(new_segment)"},{"line_number":107,"context_line":"                context.session.flush()"},{"line_number":108,"context_line":"            except db_exc.DBReferenceError:"},{"line_number":109,"context_line":"                raise n_exc.NetworkNotFound(net_id\u003dnetwork_id)"},{"line_number":110,"context_line":"            registry.notify(resources.SEGMENT, events.PRECOMMIT_CREATE, self,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_20ffd035","line":107,"range":{"start_line":107,"start_character":32,"end_line":107,"end_character":39},"updated":"2016-07-02 06:50:03.000000000","message":"I suggest that we use \u0027flush(new_segment)\u0027 here to be more explicit about the \u0027DBReferenceError\u0027.","commit_id":"42b0595645bd39c76a89092458590f54d14368f0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"caa907cf0f2f1c33fed1c72352d39ccc50170944","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            new_segment \u003d db.NetworkSegment(**args)"},{"line_number":105,"context_line":"            try:"},{"line_number":106,"context_line":"                context.session.add(new_segment)"},{"line_number":107,"context_line":"                context.session.flush()"},{"line_number":108,"context_line":"            except db_exc.DBReferenceError:"},{"line_number":109,"context_line":"                raise n_exc.NetworkNotFound(net_id\u003dnetwork_id)"},{"line_number":110,"context_line":"            registry.notify(resources.SEGMENT, events.PRECOMMIT_CREATE, self,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_bce96881","line":107,"range":{"start_line":107,"start_character":32,"end_line":107,"end_character":39},"in_reply_to":"1aa78d24_20ffd035","updated":"2016-07-12 20:48:58.000000000","message":"Done. The correct way to do this is:\n\ncontext.session.flush([new_segment])\n\nThe argument passed to flush has to be a collection: http://docs.sqlalchemy.org/en/latest/orm/session_api.html","commit_id":"42b0595645bd39c76a89092458590f54d14368f0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"cfdd3d2b900b18c1035c0b31925a25b2f46bf7d5","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            new_segment \u003d db.NetworkSegment(**args)"},{"line_number":101,"context_line":"            try:"},{"line_number":102,"context_line":"                context.session.add(new_segment)"},{"line_number":103,"context_line":"                context.session.flush([new_segment])"},{"line_number":104,"context_line":"            except db_exc.DBReferenceError:"},{"line_number":105,"context_line":"                raise n_exc.NetworkNotFound(net_id\u003dnetwork_id)"},{"line_number":106,"context_line":"            registry.notify(resources.SEGMENT, events.PRECOMMIT_CREATE, self,"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_8527f2c8","line":103,"range":{"start_line":103,"start_character":38,"end_line":103,"end_character":51},"updated":"2016-08-30 00:15:16.000000000","message":"This is a problem. This is causing most of the failures in this patch [1]. When I change this to the following, the errors go away:\n\n  context.session.flush()\n\n [1] https://review.openstack.org/#/c/293305/40","commit_id":"056b9ca677d5bacbc1ef01eefbef7bd947cd0cae"}],"neutron/tests/unit/extensions/test_segment.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"92a991aaab0c7fd80ec1a68d463d92138ddbae06","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def _make_segment(self, fmt, **kwargs):"},{"line_number":86,"context_line":"        res \u003d self._create_segment(fmt, **kwargs)"},{"line_number":87,"context_line":"        if res.status_int \u003e\u003d webob.exc.HTTPClientError.code:"},{"line_number":88,"context_line":"            res.charset \u003d \u0027utf8\u0027"},{"line_number":89,"context_line":"            raise webob.exc.HTTPClientError("},{"line_number":90,"context_line":"                code\u003dres.status_int, explanation\u003dstr(res))"},{"line_number":91,"context_line":"        return self.deserialize(fmt, res)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_0464b11f","line":88,"range":{"start_line":88,"start_character":12,"end_line":88,"end_character":32},"updated":"2016-07-12 17:03:31.000000000","message":"Is this related to this change?  What is this for?","commit_id":"42b0595645bd39c76a89092458590f54d14368f0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"caa907cf0f2f1c33fed1c72352d39ccc50170944","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def _make_segment(self, fmt, **kwargs):"},{"line_number":86,"context_line":"        res \u003d self._create_segment(fmt, **kwargs)"},{"line_number":87,"context_line":"        if res.status_int \u003e\u003d webob.exc.HTTPClientError.code:"},{"line_number":88,"context_line":"            res.charset \u003d \u0027utf8\u0027"},{"line_number":89,"context_line":"            raise webob.exc.HTTPClientError("},{"line_number":90,"context_line":"                code\u003dres.status_int, explanation\u003dstr(res))"},{"line_number":91,"context_line":"        return self.deserialize(fmt, res)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_1f286e99","line":88,"range":{"start_line":88,"start_character":12,"end_line":88,"end_character":32},"in_reply_to":"1aa78d24_0464b11f","updated":"2016-07-12 20:48:58.000000000","message":"Yes, it is related. With PY34, line 90 will throw the exception shown here: http://paste.openstack.org/show/520658/","commit_id":"42b0595645bd39c76a89092458590f54d14368f0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"92a991aaab0c7fd80ec1a68d463d92138ddbae06","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                                network_id\u003duuidutils.generate_uuid(),"},{"line_number":147,"context_line":"                                physical_network\u003d\u0027phys_net\u0027,"},{"line_number":148,"context_line":"                                segmentation_id\u003d200)"},{"line_number":149,"context_line":"        self.assertEqual(404, exc.code)"},{"line_number":150,"context_line":"        self.assertIn(\u0027NetworkNotFound\u0027, exc.explanation)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_create_segment_no_phys_net(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_64a13594","line":149,"range":{"start_line":149,"start_character":25,"end_line":149,"end_character":28},"updated":"2016-07-12 17:03:31.000000000","message":"Use a constant for 404.  Most people know what 404 means but they might note and the constant helps readability.","commit_id":"42b0595645bd39c76a89092458590f54d14368f0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"caa907cf0f2f1c33fed1c72352d39ccc50170944","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                                network_id\u003duuidutils.generate_uuid(),"},{"line_number":147,"context_line":"                                physical_network\u003d\u0027phys_net\u0027,"},{"line_number":148,"context_line":"                                segmentation_id\u003d200)"},{"line_number":149,"context_line":"        self.assertEqual(404, exc.code)"},{"line_number":150,"context_line":"        self.assertIn(\u0027NetworkNotFound\u0027, exc.explanation)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_create_segment_no_phys_net(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_df5546fa","line":149,"range":{"start_line":149,"start_character":25,"end_line":149,"end_character":28},"in_reply_to":"1aa78d24_64a13594","updated":"2016-07-12 20:48:58.000000000","message":"Done","commit_id":"42b0595645bd39c76a89092458590f54d14368f0"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"76d35da52148787d47d3b7f2b30ea05368826162","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                                  expected\u003dexpected_segment)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def test_create_segment_non_existent_network(self):"},{"line_number":144,"context_line":"        exc \u003d self.assertRaises(webob.exc.HTTPClientError,"},{"line_number":145,"context_line":"                                self._test_create_segment,"},{"line_number":146,"context_line":"                                network_id\u003duuidutils.generate_uuid(),"},{"line_number":147,"context_line":"                                physical_network\u003d\u0027phys_net\u0027,"},{"line_number":148,"context_line":"                                segmentation_id\u003d200)"},{"line_number":149,"context_line":"        self.assertEqual(404, exc.code)"},{"line_number":150,"context_line":"        self.assertIn(\u0027NetworkNotFound\u0027, exc.explanation)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_create_segment_no_phys_net(self):"},{"line_number":153,"context_line":"        with self.network() as network:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_80816492","line":150,"range":{"start_line":144,"start_character":8,"end_line":150,"end_character":57},"updated":"2016-07-02 07:03:45.000000000","message":"I think it would be better if we tested SegmentDbMixin.create_segment directly (i.e. assertRaises(NetworkNotFound, \u003cSegmentDbMixin\u003e.create_segment, ...)).","commit_id":"42b0595645bd39c76a89092458590f54d14368f0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"92a991aaab0c7fd80ec1a68d463d92138ddbae06","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                                  expected\u003dexpected_segment)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def test_create_segment_non_existent_network(self):"},{"line_number":144,"context_line":"        exc \u003d self.assertRaises(webob.exc.HTTPClientError,"},{"line_number":145,"context_line":"                                self._test_create_segment,"},{"line_number":146,"context_line":"                                network_id\u003duuidutils.generate_uuid(),"},{"line_number":147,"context_line":"                                physical_network\u003d\u0027phys_net\u0027,"},{"line_number":148,"context_line":"                                segmentation_id\u003d200)"},{"line_number":149,"context_line":"        self.assertEqual(404, exc.code)"},{"line_number":150,"context_line":"        self.assertIn(\u0027NetworkNotFound\u0027, exc.explanation)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_create_segment_no_phys_net(self):"},{"line_number":153,"context_line":"        with self.network() as network:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_846ee12c","line":150,"range":{"start_line":144,"start_character":8,"end_line":150,"end_character":57},"in_reply_to":"1aa78d24_80816492","updated":"2016-07-12 17:03:31.000000000","message":"Ilya, please notice that pretty much all of the tests in this file exercise the API.  Even if we did have a test which exercised create_segment directly, I\u0027d still want this API level test.  So, we\u0027d have duplicate coverage.","commit_id":"42b0595645bd39c76a89092458590f54d14368f0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"caa907cf0f2f1c33fed1c72352d39ccc50170944","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                                  expected\u003dexpected_segment)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def test_create_segment_non_existent_network(self):"},{"line_number":144,"context_line":"        exc \u003d self.assertRaises(webob.exc.HTTPClientError,"},{"line_number":145,"context_line":"                                self._test_create_segment,"},{"line_number":146,"context_line":"                                network_id\u003duuidutils.generate_uuid(),"},{"line_number":147,"context_line":"                                physical_network\u003d\u0027phys_net\u0027,"},{"line_number":148,"context_line":"                                segmentation_id\u003d200)"},{"line_number":149,"context_line":"        self.assertEqual(404, exc.code)"},{"line_number":150,"context_line":"        self.assertIn(\u0027NetworkNotFound\u0027, exc.explanation)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_create_segment_no_phys_net(self):"},{"line_number":153,"context_line":"        with self.network() as network:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_ff3e42b6","line":150,"range":{"start_line":144,"start_character":8,"end_line":150,"end_character":57},"in_reply_to":"1aa78d24_846ee12c","updated":"2016-07-12 20:48:58.000000000","message":"Here I will follow Carl\u0027s guidance","commit_id":"42b0595645bd39c76a89092458590f54d14368f0"}]}
