)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"555ef0b36531ddaf9254dc3d9b42edae482f43c8","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Default some flavor fields loaded from instance"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"For whatever reason, the non-notification Flavor object"},{"line_number":10,"context_line":"does not provide defaults for disabled, is_public or swap"},{"line_number":11,"context_line":"fields even though the data model does."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7f96bb07_22ed0def","line":9,"updated":"2018-01-11 15:12:48.000000000","message":"I\u0027d really like to know why this is happening if it is.","commit_id":"4e137b5f1f9dd6c1155b48b9d64a17ed839895a5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"555ef0b36531ddaf9254dc3d9b42edae482f43c8","unresolved":false,"context_lines":[{"line_number":10,"context_line":"does not provide defaults for disabled, is_public or swap"},{"line_number":11,"context_line":"fields even though the data model does."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Any versioned notifications using the FlavorPayload are"},{"line_number":14,"context_line":"pulling those from the embedded instance.flavor, which"},{"line_number":15,"context_line":"could have been migrated years ago, and might be missing"},{"line_number":16,"context_line":"some fields from the embedded flavor (like these default"},{"line_number":17,"context_line":"ones)."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"This makes sure that when the Flavor object is deserialized"},{"line_number":20,"context_line":"these fields are checked and if they are not defined then"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7f96bb07_62cc7589","line":17,"range":{"start_line":13,"start_character":0,"end_line":17,"end_character":6},"updated":"2018-01-11 15:12:48.000000000","message":"The fields you describe have been on the flavor model since long before we were stashing them on the instance. I can\u0027t really think of why they wouldn\u0027t be in the stashed version.","commit_id":"4e137b5f1f9dd6c1155b48b9d64a17ed839895a5"}],"nova/notifications/objects/base.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"92329ac83d60bb28777b318a7c360016f0c59731","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                # nullable, but that means that either the source object is not"},{"line_number":134,"context_line":"                # properly initialized or the payload field needs to be defined"},{"line_number":135,"context_line":"                # as nullable"},{"line_number":136,"context_line":"                try:"},{"line_number":137,"context_line":"                    setattr(self, key, None)"},{"line_number":138,"context_line":"                except ValueError:"},{"line_number":139,"context_line":"                    with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":140,"context_line":"                        # The field is not nullable, so try and set defaults as"},{"line_number":141,"context_line":"                        # a last effort. If it doesn\u0027t set a default, reraise"},{"line_number":142,"context_line":"                        # the ValueError."},{"line_number":143,"context_line":"                        self.obj_set_defaults()"},{"line_number":144,"context_line":"                        if key in self:"},{"line_number":145,"context_line":"                            ctxt.reraise \u003d False"},{"line_number":146,"context_line":"        self.populated \u003d True"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_f843be3d","line":144,"range":{"start_line":136,"start_character":11,"end_line":144,"end_character":6},"updated":"2017-12-20 09:43:41.000000000","message":"For me it seems more logical to set defaults first and if that doesn\u0027t help then try to set None as a last resort. So I suggest to change the order of \n  setattr(self, key, None)\nand \n  self.obj_set_defaults()","commit_id":"58f967b83cc9215f0d66d228463fc032464a8615"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"db9cd4587d763db01d49cee999f4c6d15a164ef4","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                # nullable, but that means that either the source object is not"},{"line_number":134,"context_line":"                # properly initialized or the payload field needs to be defined"},{"line_number":135,"context_line":"                # as nullable"},{"line_number":136,"context_line":"                try:"},{"line_number":137,"context_line":"                    setattr(self, key, None)"},{"line_number":138,"context_line":"                except ValueError:"},{"line_number":139,"context_line":"                    with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":140,"context_line":"                        # The field is not nullable, so try and set defaults as"},{"line_number":141,"context_line":"                        # a last effort. If it doesn\u0027t set a default, reraise"},{"line_number":142,"context_line":"                        # the ValueError."},{"line_number":143,"context_line":"                        self.obj_set_defaults()"},{"line_number":144,"context_line":"                        if key in self:"},{"line_number":145,"context_line":"                            ctxt.reraise \u003d False"},{"line_number":146,"context_line":"        self.populated \u003d True"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf8cb3f7_632a5ce8","line":144,"range":{"start_line":136,"start_character":11,"end_line":144,"end_character":6},"in_reply_to":"df87a7cf_f843be3d","updated":"2017-12-20 14:12:35.000000000","message":"Yeah I agree, I thought about that later after posting this, but it was late.","commit_id":"58f967b83cc9215f0d66d228463fc032464a8615"}],"nova/notifications/objects/flavor.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"92329ac83d60bb28777b318a7c360016f0c59731","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    # Version 1.3: Make projects and extra_specs field nullable as they are"},{"line_number":37,"context_line":"    # not always available when a notification is emitted."},{"line_number":38,"context_line":"    # Version 1.4: Added description field."},{"line_number":39,"context_line":"    # Version 1.5: Set default values for disabled, is_public and swap fields."},{"line_number":40,"context_line":"    VERSION \u003d \u00271.5\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    # NOTE: if we\u0027d want to rename some fields(memory_mb-\u003eram, root_gb-\u003edisk,"}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_98d2b25b","line":39,"updated":"2017-12-20 09:43:41.000000000","message":"As far as I see this tries to patch up a violation of the nova.objects.flavor.Flavor() object model, but it does it in FlavorPayload. I would rather try to fix this violation when the Flavor object is created as that would fix the problem for every user of such Flavor object not just for the particular notification usage.","commit_id":"58f967b83cc9215f0d66d228463fc032464a8615"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6fbfffedd6cde8729bb773d9d3849eccaf32d6b3","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    # Version 1.3: Make projects and extra_specs field nullable as they are"},{"line_number":37,"context_line":"    # not always available when a notification is emitted."},{"line_number":38,"context_line":"    # Version 1.4: Added description field."},{"line_number":39,"context_line":"    # Version 1.5: Set default values for disabled, is_public and swap fields."},{"line_number":40,"context_line":"    VERSION \u003d \u00271.5\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    # NOTE: if we\u0027d want to rename some fields(memory_mb-\u003eram, root_gb-\u003edisk,"}],"source_content_type":"text/x-python","patch_set":2,"id":"df87a7cf_b37b198a","line":39,"in_reply_to":"df87a7cf_98d2b25b","updated":"2017-12-20 10:23:40.000000000","message":"Can we simply check in nova.objects.flavor.Flavor._obj_from_primitive() [1] if these fields are missing and defaulting them there?\n\nThen FlavorPayload version doesn\u0027t need to be bumped and every Flavor user can see a consistent Flavor object with fields filled as expected\n\nhttps://github.com/openstack/nova/blob/2506afda54d2ccbac0ec6083362bc9b1f789d1f3/nova/objects/flavor.py#L360","commit_id":"58f967b83cc9215f0d66d228463fc032464a8615"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"db9cd4587d763db01d49cee999f4c6d15a164ef4","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    # Version 1.3: Make projects and extra_specs field nullable as they are"},{"line_number":37,"context_line":"    # not always available when a notification is emitted."},{"line_number":38,"context_line":"    # Version 1.4: Added description field."},{"line_number":39,"context_line":"    # Version 1.5: Set default values for disabled, is_public and swap fields."},{"line_number":40,"context_line":"    VERSION \u003d \u00271.5\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    # NOTE: if we\u0027d want to rename some fields(memory_mb-\u003eram, root_gb-\u003edisk,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf8cb3f7_63133cba","line":39,"in_reply_to":"df87a7cf_98d2b25b","updated":"2017-12-20 14:12:35.000000000","message":"I didn\u0027t want to change the defaults in the Flavor object in this change because we can\u0027t backport that, but we don\u0027t pass FlavorPayload over RPC so I figured we could backport that.","commit_id":"58f967b83cc9215f0d66d228463fc032464a8615"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"db9cd4587d763db01d49cee999f4c6d15a164ef4","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    # Version 1.3: Make projects and extra_specs field nullable as they are"},{"line_number":37,"context_line":"    # not always available when a notification is emitted."},{"line_number":38,"context_line":"    # Version 1.4: Added description field."},{"line_number":39,"context_line":"    # Version 1.5: Set default values for disabled, is_public and swap fields."},{"line_number":40,"context_line":"    VERSION \u003d \u00271.5\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    # NOTE: if we\u0027d want to rename some fields(memory_mb-\u003eram, root_gb-\u003edisk,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf8cb3f7_837d20e9","line":39,"in_reply_to":"df87a7cf_b37b198a","updated":"2017-12-20 14:12:35.000000000","message":"Yeah that might work, and not require any version bump which would be even better. I was looking at doing something in obj_load_attr but I don\u0027t think we can because the flavor embedded in the instance might be long gone.","commit_id":"58f967b83cc9215f0d66d228463fc032464a8615"}],"nova/objects/flavor.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"555ef0b36531ddaf9254dc3d9b42edae482f43c8","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        if \u0027disabled\u0027 not in self:"},{"line_number":382,"context_line":"            self.disabled \u003d False"},{"line_number":383,"context_line":"        if \u0027is_public\u0027 not in self:"},{"line_number":384,"context_line":"            self.is_public \u003d True"},{"line_number":385,"context_line":"        return self"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    @base.remotable_classmethod"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_029ed162","line":384,"updated":"2018-01-11 15:12:48.000000000","message":"This is really a hack, IMHO. At a minimum we should set default\u003d on the fields and use self.obj_set_defaults(). However, this makes the object behave differently from every other object we have. If we send a flavor over RPC without those fields set, this code will be triggered instead of causing a lazy-load on the other side like someone would expect.","commit_id":"4e137b5f1f9dd6c1155b48b9d64a17ed839895a5"}]}
