)]}'
{"oslo_versionedobjects/base.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"62656ba4329232a02d3c75c7166aa1ea056803b5","unresolved":false,"context_lines":[{"line_number":389,"context_line":"    @classmethod"},{"line_number":390,"context_line":"    def _obj_from_primitive(cls, context, objver, primitive,"},{"line_number":391,"context_line":"                            leave_dirty\u003dFalse):"},{"line_number":392,"context_line":"        self \u003d cls()"},{"line_number":393,"context_line":"        self._context \u003d context"},{"line_number":394,"context_line":"        self.VERSION \u003d objver"},{"line_number":395,"context_line":"        objdata \u003d cls._obj_primitive_field(primitive, \u0027data\u0027)"},{"line_number":396,"context_line":"        changes \u003d cls._obj_primitive_field(primitive, \u0027changes\u0027, [])"},{"line_number":397,"context_line":"        for name, field in self.fields.items():"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_9613e465","line":394,"range":{"start_line":392,"start_character":8,"end_line":394,"end_character":29},"updated":"2018-09-26 09:47:16.000000000","message":"ok so first we constuct a now instance of the class\nand rebind self to point to it, setting the context\nand versions.","commit_id":"0f1dbd018e869ac8d770af9cc2845d822276cf73"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"62656ba4329232a02d3c75c7166aa1ea056803b5","unresolved":false,"context_lines":[{"line_number":392,"context_line":"        self \u003d cls()"},{"line_number":393,"context_line":"        self._context \u003d context"},{"line_number":394,"context_line":"        self.VERSION \u003d objver"},{"line_number":395,"context_line":"        objdata \u003d cls._obj_primitive_field(primitive, \u0027data\u0027)"},{"line_number":396,"context_line":"        changes \u003d cls._obj_primitive_field(primitive, \u0027changes\u0027, [])"},{"line_number":397,"context_line":"        for name, field in self.fields.items():"},{"line_number":398,"context_line":"            if name in objdata:"},{"line_number":399,"context_line":"                setattr(self, name, field.from_primitive(self, name,"},{"line_number":400,"context_line":"                                                         objdata[name]))"},{"line_number":401,"context_line":"        if not leave_dirty:"},{"line_number":402,"context_line":"            self._changed_fields \u003d set("},{"line_number":403,"context_line":"                [x for x in changes if x in self.fields])"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_7153b217","line":400,"range":{"start_line":395,"start_character":8,"end_line":400,"end_character":72},"updated":"2018-09-26 09:47:16.000000000","message":"then we extract the data and changes fileds from the primitive serialisation.\n\nnext we loop over all the declared fileds of the object\nand set the corresponding attibte on the new empty instance.\n\nthis marks all valid fileds that were contained in the primitive object as changed on self.","commit_id":"0f1dbd018e869ac8d770af9cc2845d822276cf73"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f2e8b75aa6eb72bf5ac5524a341d3b8fa4d654a2","unresolved":false,"context_lines":[{"line_number":398,"context_line":"            if name in objdata:"},{"line_number":399,"context_line":"                setattr(self, name, field.from_primitive(self, name,"},{"line_number":400,"context_line":"                                                         objdata[name]))"},{"line_number":401,"context_line":"        if not leave_dirty:"},{"line_number":402,"context_line":"            self._changed_fields \u003d set("},{"line_number":403,"context_line":"                [x for x in changes if x in self.fields])"},{"line_number":404,"context_line":"        return self"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_14af659d","line":401,"updated":"2018-10-01 15:41:54.000000000","message":"This is a major violation of the contract here I think. The to/from primitive operations are supposed to be symmetric and not importing the changed fields set from the primitive breaks that.\n\nIf I have an old version of an object, with some fields that are no longer correct in the database, I don\u0027t overwrite them because I\u0027m tracking the ones I do need to update in the changed list. Adding this \"everything becomes dirty\" function will make that silently behave differently.\n\nIf you want to do something like this, I think you need to something like obj.obj_make_everything_dirty() that you run after the fact, with specific intent.","commit_id":"0f1dbd018e869ac8d770af9cc2845d822276cf73"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"62656ba4329232a02d3c75c7166aa1ea056803b5","unresolved":false,"context_lines":[{"line_number":398,"context_line":"            if name in objdata:"},{"line_number":399,"context_line":"                setattr(self, name, field.from_primitive(self, name,"},{"line_number":400,"context_line":"                                                         objdata[name]))"},{"line_number":401,"context_line":"        if not leave_dirty:"},{"line_number":402,"context_line":"            self._changed_fields \u003d set("},{"line_number":403,"context_line":"                [x for x in changes if x in self.fields])"},{"line_number":404,"context_line":"        return self"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    @classmethod"},{"line_number":407,"context_line":"    def obj_from_primitive(cls, primitive, context\u003dNone, leave_dirty\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_51bd5601","line":404,"range":{"start_line":401,"start_character":8,"end_line":404,"end_character":19},"updated":"2018-09-26 09:47:16.000000000","message":"finally if leave_dirty is false\n\nself._changed_fields is set to  the set of changed fields from the primative object passed in if the filed is valid for the current objects e.g. field in self.fields\n\nif leave_dirty is True\nall fileds that were marked as changed by the loop on line 397 are left unchanged.","commit_id":"0f1dbd018e869ac8d770af9cc2845d822276cf73"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"06ab3561f7fa3c8e6853610e726079c14860f608","unresolved":false,"context_lines":[{"line_number":415,"context_line":"            raise exception.UnsupportedObjectError("},{"line_number":416,"context_line":"                objtype\u003d\u0027%s.%s\u0027 % (objns, objname))"},{"line_number":417,"context_line":"        objclass \u003d cls.obj_class_from_name(objname, objver)"},{"line_number":418,"context_line":"        return objclass._obj_from_primitive(context, objver, primitive,"},{"line_number":419,"context_line":"                                            leave_dirty\u003dleave_dirty)"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"    def __deepcopy__(self, memo):"},{"line_number":422,"context_line":"        \"\"\"Efficiently make a deep copy of this object.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_63c3e93a","line":419,"range":{"start_line":418,"start_character":15,"end_line":419,"end_character":68},"updated":"2018-09-26 10:47:56.000000000","message":"so i tought i had a theory for this but im now unsure.\n\neffectivly i was speculating that maybe there is some overload resolution edgecase you are hitting when invoking the drived classes via the registry.\n\n\nthe nova issue is being raised form this call\n\nhttps://github.com/openstack/nova/blob/41ac87f812f239e38ad3b72c2f2108523ad3444d/nova/objects/request_spec.py#L494\n\nthat is invoked form \nhttps://github.com/openstack/nova/blob/41ac87f812f239e38ad3b72c2f2108523ad3444d/nova/objects/request_spec.py#L585\n\nin this invocation we are invoking the class method passing in a object of the class rather then the type.\n\ni.e. we are calling it as \n self._from_db_object(self._context, self, db_spec)\nand then invoking \nspec_obj \u003d spec.obj_from_primitive(jsonutils.loads(db_spec[\u0027spec\u0027]))\n\none thing im not certin about in python is wether it is valid to invoke a class methon via self or if the Class must be used. in this case spec is a RequestSpec object so i dont know if that is correct...\n\nlooking through the nova object inheritence i dont see anything that is over riding obj_from_primative for this object.\n\n\nwhat i had orignially assumed was that one of the overrides of obj_from_primitve here https://github.com/openstack/nova/search?q\u003d%22def+obj_from_primitive%22\u0026unscoped_q\u003d%22def+obj_from_primitive%22 \nwas resulting in the failure as they do not accpet the new keyworkd arg. specifically my theroy is that the embed numa_topolgy object  is the issue but that is a guess.\n\n\nthis really does look like it should be working.","commit_id":"0f1dbd018e869ac8d770af9cc2845d822276cf73"}],"oslo_versionedobjects/tests/test_objects.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"62656ba4329232a02d3c75c7166aa1ea056803b5","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                     \u0027versioned_object.namespace\u0027: \u0027versionedobjects\u0027,"},{"line_number":784,"context_line":"                     \u0027versioned_object.version\u0027: \u00271.5\u0027,"},{"line_number":785,"context_line":"                     \u0027versioned_object.data\u0027: {\u0027foo\u0027: 1}}"},{"line_number":786,"context_line":"        real_method \u003d MyObj._obj_from_primitive"},{"line_number":787,"context_line":""},{"line_number":788,"context_line":"        def _obj_from_primitive(*args, **kwargs):"},{"line_number":789,"context_line":"            return real_method(*args, **kwargs)"},{"line_number":790,"context_line":""},{"line_number":791,"context_line":"        with mock.patch.object(MyObj, \u0027_obj_from_primitive\u0027) as ofp:"},{"line_number":792,"context_line":"            ofp.side_effect \u003d _obj_from_primitive"},{"line_number":793,"context_line":"            obj \u003d MyObj.obj_from_primitive(primitive, leave_dirty\u003dTrue)"},{"line_number":794,"context_line":"            ofp.assert_called_once_with(None, \u00271.5\u0027, primitive,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_311e9a0d","line":791,"range":{"start_line":786,"start_character":8,"end_line":791,"end_character":68},"updated":"2018-09-26 09:47:16.000000000","message":"im obviously missing why it had to be mocked this way\nbut its consistent with other tests so ok.","commit_id":"0f1dbd018e869ac8d770af9cc2845d822276cf73"}]}
