)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"fd7c3e908a2043245b46f98c9aa86b9ad3686d74","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fixed logging for oslo versioned objects"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Earlier, when we wanted to log a message with an object as a parameter,"},{"line_number":10,"context_line":"obj_attr_is_set method used to check name parameter, which was a wrong"},{"line_number":11,"context_line":"approach. Now, when the parameter\u0027s name is present in obj_extra_fields"},{"line_number":12,"context_line":"dict, we avoid calling obj_attr_is_set and simply get() it."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"The other cause was a difference between fields names: size (in volume)"},{"line_number":15,"context_line":"and volume_size (in snapshot), and inproper condition statement in lvm"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"da6ed579_68605f36","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":59},"updated":"2016-01-12 12:55:55.000000000","message":"An information that this is caused by oslo.logging and the way how it handles resource parameter [1] would be helpful to understand this commit. This is caused by lines such as:\n\n LOG.info(_LI(\"Created volume successfully.\"), resource\u003dvol_ref)\n\n[1] https://github.com/openstack/oslo.log/blob/master/oslo_log/log.py#L163-L187","commit_id":"31b664bbd5266052434944dfc8ea18d142277dcb"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"54b58bc40ba80cc09f08c85d422bee6c99942f47","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fixed logging for oslo versioned objects"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Earlier, when we wanted to log a message with an object as a parameter,"},{"line_number":10,"context_line":"obj_attr_is_set method used to check name parameter, which was a wrong"},{"line_number":11,"context_line":"approach. Now, when the parameter\u0027s name is present in obj_extra_fields"},{"line_number":12,"context_line":"dict, we avoid calling obj_attr_is_set and simply get() it."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"The other cause was a difference between fields names: size (in volume)"},{"line_number":15,"context_line":"and volume_size (in snapshot), and inproper condition statement in lvm"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"da6ed579_da57b100","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":59},"in_reply_to":"da6ed579_68605f36","updated":"2016-01-12 23:07:42.000000000","message":"I think this would be a good addition to have in the commit.  Can we roll another patch and add this?","commit_id":"31b664bbd5266052434944dfc8ea18d142277dcb"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"8e2c1a0729a95f96d0488d12e03c220ab240d3f7","unresolved":false,"context_lines":[{"line_number":14,"context_line":"return False and the logger will try to get the \u0027type\u0027 parameter, which"},{"line_number":15,"context_line":"does not exist in some versioned objects (please take a look at:"},{"line_number":16,"context_line":"https://github.com/openstack/oslo.log/blob/master/oslo_log/log.py,"},{"line_number":17,"context_line":"line 163-187)."},{"line_number":18,"context_line":"Now, when the parameter\u0027s name is present in obj_extra_fields"},{"line_number":19,"context_line":"dict, we avoid calling obj_attr_is_set and simply get() it."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7af24918_dbc081e3","line":17,"updated":"2016-03-01 15:40:35.000000000","message":"Please don\u0027t refer to github blob/master line numbers in a commit message -- this will change over time and won\u0027t make any sense for someone reading it later.","commit_id":"fa996ae3de994b4da0331aa4708efe2f9cabc5c3"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"183e8fbc7d4abf694b0c231f1f2ad253224f6016","unresolved":false,"context_lines":[{"line_number":14,"context_line":"return False and the logger will try to get the \u0027type\u0027 parameter, which"},{"line_number":15,"context_line":"does not exist in some versioned objects (please take a look at:"},{"line_number":16,"context_line":"https://github.com/openstack/oslo.log/blob/master/oslo_log/log.py,"},{"line_number":17,"context_line":"line 163-187)."},{"line_number":18,"context_line":"Now, when the parameter\u0027s name is present in obj_extra_fields"},{"line_number":19,"context_line":"dict, we avoid calling obj_attr_is_set and simply get() it."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7af24918_6804f37d","line":17,"in_reply_to":"7af24918_dbc081e3","updated":"2016-03-01 18:23:08.000000000","message":"I\u0027ve changed the URL to refer to particular state of the git tree on github and shortened it.","commit_id":"fa996ae3de994b4da0331aa4708efe2f9cabc5c3"}],"cinder/objects/base.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"b29ae3b3137604a873b7b50f2048d6eda3baf313","unresolved":false,"context_lines":[{"line_number":260,"context_line":"                       \u0027attribute_name\u0027: key})"},{"line_number":261,"context_line":"            return None"},{"line_number":262,"context_line":"        if (value !\u003d base._NotSpecifiedSentinel and"},{"line_number":263,"context_line":"                not self.obj_attr_is_set(key) and"},{"line_number":264,"context_line":"                key not in self.obj_extra_fields):"},{"line_number":265,"context_line":"            return value"},{"line_number":266,"context_line":"        else:"},{"line_number":267,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_d66a571a","line":264,"range":{"start_line":263,"start_character":46,"end_line":264,"end_character":48},"updated":"2016-01-12 11:02:06.000000000","message":"I would move that condition just after \n\n value !\u003d base._NotSpecifiedSentinel\n\nI think it\u0027s cheaper to just check if it exists in obj_extra_fields than go through call stack obj_attr_is_set is invoking (a long one).\n\nAlso I think this change requires a unit test. You can add an assert to cinder.tests.unit.objects.base.TestCinderDictCompat.","commit_id":"8e44f206ee79a549ddddcddc54b602a3c311bc33"}],"cinder/tests/unit/objects/test_base.py":[{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"78b6034fb4b8216fb3beda15b36014a1871f0240","unresolved":false,"context_lines":[{"line_number":591,"context_line":"        obj.abc \u003d \u0027val2\u0027"},{"line_number":592,"context_line":"        self.assertEqual(\u0027val2\u0027, obj.get(\u0027abc\u0027, \u0027val\u0027))"},{"line_number":593,"context_line":"        self.assertEqual(42, obj.get(\u0027foo\u0027))"},{"line_number":594,"context_line":"        self.assertEqual(42, obj.get(\u0027foo\u0027, None))"},{"line_number":595,"context_line":""},{"line_number":596,"context_line":"        self.assertTrue(\u0027foo\u0027 in obj)"},{"line_number":597,"context_line":"        self.assertTrue(\u0027abc\u0027 in obj)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_ab307657","line":594,"updated":"2016-01-12 20:41:15.000000000","message":"What\u0027s the difference between line 593 and 594?  obj.get(\u0027foo\u0027) defaults to None if \u0027foo\u0027 is not there.","commit_id":"31b664bbd5266052434944dfc8ea18d142277dcb"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"54b58bc40ba80cc09f08c85d422bee6c99942f47","unresolved":false,"context_lines":[{"line_number":591,"context_line":"        obj.abc \u003d \u0027val2\u0027"},{"line_number":592,"context_line":"        self.assertEqual(\u0027val2\u0027, obj.get(\u0027abc\u0027, \u0027val\u0027))"},{"line_number":593,"context_line":"        self.assertEqual(42, obj.get(\u0027foo\u0027))"},{"line_number":594,"context_line":"        self.assertEqual(42, obj.get(\u0027foo\u0027, None))"},{"line_number":595,"context_line":""},{"line_number":596,"context_line":"        self.assertTrue(\u0027foo\u0027 in obj)"},{"line_number":597,"context_line":"        self.assertTrue(\u0027abc\u0027 in obj)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_ba367de5","line":594,"in_reply_to":"da6ed579_ab307657","updated":"2016-01-12 23:07:42.000000000","message":"I believe this helps cover the new code in the base object where the key doesn\u0027t exist.","commit_id":"31b664bbd5266052434944dfc8ea18d142277dcb"}],"cinder/volume/drivers/lvm.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"b29ae3b3137604a873b7b50f2048d6eda3baf313","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            LOG.error(msg)"},{"line_number":141,"context_line":"            raise exception.VolumeBackendAPIException(data\u003dmsg)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        size_in_g \u003d volume.get(\u0027volume_size\u0027) if is_snapshot \\"},{"line_number":144,"context_line":"            else volume.get(\u0027size\u0027)"},{"line_number":145,"context_line":"        if size_in_g is None:"},{"line_number":146,"context_line":"            msg \u003d (_(\"Size for volume: %s not found, cannot secure delete.\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_f69e7b06","line":143,"range":{"start_line":143,"start_character":61,"end_line":143,"end_character":62},"updated":"2016-01-12 11:02:06.000000000","message":"Can you use parentheses here instead of wrapping line using \"\\\"? It\u0027s preferred to avoid that.","commit_id":"8e44f206ee79a549ddddcddc54b602a3c311bc33"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"2b8843174f7514270cc4e0a3027a6cbccf58083b","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            raise exception.VolumeBackendAPIException(data\u003dmsg)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        size_in_g \u003d (volume.get(\u0027volume_size\u0027) if is_snapshot"},{"line_number":144,"context_line":"                     else volume.get(\u0027size\u0027))"},{"line_number":145,"context_line":"        if size_in_g is None:"},{"line_number":146,"context_line":"            msg \u003d (_(\"Size for volume: %s not found, cannot secure delete.\")"},{"line_number":147,"context_line":"                   % volume[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_05aed397","line":144,"updated":"2016-01-14 17:51:51.000000000","message":"What happened before this fix?  This looks rather scary because a) it has security implications here and b) I hope this isn\u0027t going to be a common problem with objects?\n\nI suspect this needs to be split into a separate bug that we can consider for backport.","commit_id":"9a0aff02841f6e0e3be1b36d22afcae763d2750f"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"761c17ab78afa82f2dbcb7cdf03c28f712f2eee0","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            raise exception.VolumeBackendAPIException(data\u003dmsg)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        size_in_g \u003d (volume.get(\u0027volume_size\u0027) if is_snapshot"},{"line_number":144,"context_line":"                     else volume.get(\u0027size\u0027))"},{"line_number":145,"context_line":"        if size_in_g is None:"},{"line_number":146,"context_line":"            msg \u003d (_(\"Size for volume: %s not found, cannot secure delete.\")"},{"line_number":147,"context_line":"                   % volume[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_bb67e8e7","line":144,"in_reply_to":"da6ed579_05aed397","updated":"2016-01-14 18:22:50.000000000","message":"I\u0027m not opposed to splitting the patch, but I hardly see a backport potential - this is just fixing annoying log entries coming from [1]. We want that log, because we want to know if something is looking for a non-existing object field as with objects this shouldn\u0027t happen.\n\nChange in this particular line isn\u0027t related to o.vo at all. You may notice that this method may get either a volume or a snapshot. Volume doesn\u0027t have \u0027volume_size\u0027 field, so it\u0027s better to determine which field to fetch using \u0027is_snapshot\u0027 argument.\n\nAnyway it sucks that an argument called \"volume\" can sometimes be a snapshot…\n\n[1] https://github.com/openstack/cinder/blob/master/cinder/objects/base.py#L257-L260","commit_id":"9a0aff02841f6e0e3be1b36d22afcae763d2750f"}]}
