)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"eeb077601c898d73000b049e0210edf4392d2327","unresolved":false,"context_lines":[{"line_number":11,"context_line":"for faster landing separating from [1] and will rebase [1] on top"},{"line_number":12,"context_line":"of this patch. It also add object db api for one_or_none()"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"[1]. https://review.openstack.org/#/c/381333/"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I1968c3c8e832db22d9fddf46955eb0879cf9897c"},{"line_number":17,"context_line":"Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"da6895a0_33a388a0","line":14,"updated":"2016-10-20 21:31:32.000000000","message":"I commented in https://review.openstack.org/#/c/381333/9/neutron/plugins/ml2/extensions/dns_integration.py that it\u0027s not clear whether .one() usage is needed there in the first place.","commit_id":"f39b0aff8089b40708bb9d545b42bca326fbdb80"}],"neutron/objects/base.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"eeb077601c898d73000b049e0210edf4392d2327","unresolved":false,"context_lines":[{"line_number":477,"context_line":"        :raises: sqlalchemy.orm.exc.MultipleResultsFound: if query"},{"line_number":478,"context_line":"        returns multiple rows"},{"line_number":479,"context_line":"        \"\"\""},{"line_number":480,"context_line":"        cls.validate_filters(**kwargs)"},{"line_number":481,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":482,"context_line":"            db_obj \u003d obj_db_api.get_one_object("},{"line_number":483,"context_line":"                context, cls.db_model,"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6895a0_73db401c","line":480,"updated":"2016-10-20 21:31:32.000000000","message":"you should compare what you have here with get_object() validation in lines 430-435.","commit_id":"f39b0aff8089b40708bb9d545b42bca326fbdb80"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"eeb077601c898d73000b049e0210edf4392d2327","unresolved":false,"context_lines":[{"line_number":479,"context_line":"        \"\"\""},{"line_number":480,"context_line":"        cls.validate_filters(**kwargs)"},{"line_number":481,"context_line":"        with db_api.autonested_transaction(context.session):"},{"line_number":482,"context_line":"            db_obj \u003d obj_db_api.get_one_object("},{"line_number":483,"context_line":"                context, cls.db_model,"},{"line_number":484,"context_line":"                **cls.modify_fields_to_db(kwargs)"},{"line_number":485,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6895a0_f334b04b","line":482,"updated":"2016-10-20 21:31:32.000000000","message":"so if it\u0027s not present, you will raise an sqlalchemy exception here? Is it intended behaviour?","commit_id":"f39b0aff8089b40708bb9d545b42bca326fbdb80"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"eeb077601c898d73000b049e0210edf4392d2327","unresolved":false,"context_lines":[{"line_number":486,"context_line":"            return cls._load_object(context, db_obj)"},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"    @classmethod"},{"line_number":489,"context_line":"    def get_one_or_none_object(cls, context, **kwargs):"},{"line_number":490,"context_line":"        \"\"\""},{"line_number":491,"context_line":"        Fetch exactly one result or nonefrom DB and convert to OVO."},{"line_number":492,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da6895a0_73c42040","line":489,"updated":"2016-10-20 21:31:32.000000000","message":"get_object() *is* \"one or None\" (it will return None if no matching object is found; and it guarantees that filters passed into it result in a unique object). I doubt we need that new method.","commit_id":"f39b0aff8089b40708bb9d545b42bca326fbdb80"}],"neutron/objects/db/api.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"eeb077601c898d73000b049e0210edf4392d2327","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    return _get_filter_query(context, model, **kwargs).first()"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def get_one_object(context, model, **kwargs):"},{"line_number":37,"context_line":"    return _get_filter_query(context, model, **kwargs).one()"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da6895a0_b31158b2","line":36,"updated":"2016-10-20 21:31:32.000000000","message":"I don\u0027t see unit tests targeting these new functions.","commit_id":"f39b0aff8089b40708bb9d545b42bca326fbdb80"}],"neutron/tests/unit/objects/test_base.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"812fa9698517b9129d6dd1561d390f08a05c0327","unresolved":false,"context_lines":[{"line_number":1247,"context_line":"        obj_keys \u003d self.generate_object_keys(self._test_class)"},{"line_number":1248,"context_line":"        self.assertRaises(sqlalchemy.orm.exc.NoResultFound,"},{"line_number":1249,"context_line":"                          self._test_class.get_one_object, self.context,"},{"line_number":1250,"context_line":"                          **obj_keys)"},{"line_number":1251,"context_line":""},{"line_number":1252,"context_line":"    @mock.patch(SQLALCHEMY_COMMIT)"},{"line_number":1253,"context_line":"    def test_get_objects_single_transaction(self, mock_commit):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa6399be_f7500c0d","line":1250,"updated":"2016-10-17 21:36:49.000000000","message":"Why not add another test case for MultipleResultsFound","commit_id":"02ee22ceb58de9dfea5bc99cc8230ad4c4368a19"},{"author":{"_account_id":22218,"name":"Sindhu Devale","email":"sindhu.devale@intel.com","username":"sindhudevale"},"change_message_id":"176f6ebf62f1c38ac87c973406ccf0f834ceef33","unresolved":false,"context_lines":[{"line_number":1247,"context_line":"        obj_keys \u003d self.generate_object_keys(self._test_class)"},{"line_number":1248,"context_line":"        self.assertRaises(sqlalchemy.orm.exc.NoResultFound,"},{"line_number":1249,"context_line":"                          self._test_class.get_one_object, self.context,"},{"line_number":1250,"context_line":"                          **obj_keys)"},{"line_number":1251,"context_line":""},{"line_number":1252,"context_line":"    @mock.patch(SQLALCHEMY_COMMIT)"},{"line_number":1253,"context_line":"    def test_get_objects_single_transaction(self, mock_commit):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa6399be_dd2969f4","line":1250,"in_reply_to":"fa6399be_f7500c0d","updated":"2016-10-17 23:34:02.000000000","message":"+1","commit_id":"02ee22ceb58de9dfea5bc99cc8230ad4c4368a19"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"5dce7443d5caeb97c3ed878703552886af732174","unresolved":false,"context_lines":[{"line_number":1247,"context_line":"        obj_keys \u003d self.generate_object_keys(self._test_class)"},{"line_number":1248,"context_line":"        self.assertRaises(sqlalchemy.orm.exc.NoResultFound,"},{"line_number":1249,"context_line":"                          self._test_class.get_one_object, self.context,"},{"line_number":1250,"context_line":"                          **obj_keys)"},{"line_number":1251,"context_line":""},{"line_number":1252,"context_line":"    @mock.patch(SQLALCHEMY_COMMIT)"},{"line_number":1253,"context_line":"    def test_get_objects_single_transaction(self, mock_commit):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa6399be_f5c0dd7e","line":1250,"in_reply_to":"fa6399be_f7500c0d","updated":"2016-10-18 18:37:49.000000000","message":"miguel I was expecting that, I was going through mock to achieve that, but looked at code and found a very simple way of testing that, it would be in next PS","commit_id":"02ee22ceb58de9dfea5bc99cc8230ad4c4368a19"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"eeb077601c898d73000b049e0210edf4392d2327","unresolved":false,"context_lines":[{"line_number":15,"context_line":"import itertools"},{"line_number":16,"context_line":"import os.path"},{"line_number":17,"context_line":"import random"},{"line_number":18,"context_line":"import sqlalchemy"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import mock"},{"line_number":21,"context_line":"import netaddr"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6895a0_734980d0","line":18,"updated":"2016-10-20 21:31:32.000000000","message":"nit: that import should go to the next import section, somewhere ~ line 28-29.","commit_id":"f39b0aff8089b40708bb9d545b42bca326fbdb80"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9a67cdd2e23b3c5589d6724a9dd79d9c8ef4f159","unresolved":false,"context_lines":[{"line_number":1255,"context_line":"            self.context, **obj_keys)"},{"line_number":1256,"context_line":"        self.assertEqual(None, ob)"},{"line_number":1257,"context_line":""},{"line_number":1258,"context_line":"    def test_get_one_object_raises_multiple_result_exception(self):"},{"line_number":1259,"context_line":"        # NOTE(manjeets) checking multiple exception for get_one_object"},{"line_number":1260,"context_line":"        # and get_one_or_none_object in a same test"},{"line_number":1261,"context_line":"        obj1 \u003d self._make_object(self.obj_fields[0])"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6895a0_9303740f","line":1258,"updated":"2016-10-20 21:42:51.000000000","message":"Why not refactor this test case as follows: https://gist.github.com/miguellavalle/c38eb7512e9f48416526fb2d59801677. This way we have explicit test cases for this exception for both get_one_object and et_one_or_none_object","commit_id":"f39b0aff8089b40708bb9d545b42bca326fbdb80"}]}
