)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9ba821a93d3864dff044a6df4c72d2deb4a1127b","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"We would rather not log the full traceback in this case where we are"},{"line_number":22,"context_line":"catching the exception and emitting an INFO message, so we should use"},{"line_number":23,"context_line":"exp.format_message() instead of oslo.messaging\u0027s __str__ override."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"[1] https://github.com/openstack/oslo.messaging/blob/40c25c2/oslo_messaging/_drivers/common.py#L212"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"dfbec78f_6f0b58d5","line":23,"updated":"2019-05-15 21:18:23.000000000","message":"Hmm, should NovaException just override __str__ and call self.format_message()? Wouldn\u0027t that more generically solve this problem for this case and potentially others we don\u0027t know about?","commit_id":"99ce5eb6cde6afcb73feeb23dd7a94945a47a03f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"456b9505ec46dd15e3118f19e71c2fb08dc6269f","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"We would rather not log the full traceback in this case where we are"},{"line_number":22,"context_line":"catching the exception and emitting an INFO message, so we should use"},{"line_number":23,"context_line":"exp.format_message() instead of oslo.messaging\u0027s __str__ override."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"[1] https://github.com/openstack/oslo.messaging/blob/40c25c2/oslo_messaging/_drivers/common.py#L212"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"dfbec78f_8f9d6c67","line":23,"in_reply_to":"dfbec78f_6f0b58d5","updated":"2019-05-15 21:27:33.000000000","message":"OK the answer is oslo.messaging create a new \u003cNovaException\u003e_Remote type dynamically which extends the original NovaException and overrides __str__:\n\nhttps://github.com/openstack/oslo.messaging/blob/40c25c2/oslo_messaging/_drivers/common.py#L243\n\nSo even if we overrode NovaException.__str__ it wouldn\u0027t do what we want here.","commit_id":"99ce5eb6cde6afcb73feeb23dd7a94945a47a03f"}],"nova/compute/api.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"99c3a2416a6835ae2d7f398cfe540093dc639086","unresolved":false,"context_lines":[{"line_number":3156,"context_line":"                    raise"},{"line_number":3157,"context_line":"                else:"},{"line_number":3158,"context_line":"                    LOG.info(\u0027Skipping quiescing instance: %(reason)s.\u0027,"},{"line_number":3159,"context_line":"                             {\u0027reason\u0027: err.format_message()},"},{"line_number":3160,"context_line":"                             instance\u003dinstance)"},{"line_number":3161,"context_line":"            # NOTE(tasker): discovered that an uncaught exception could occur"},{"line_number":3162,"context_line":"            #               after the instance has been frozen. catch and thaw."}],"source_content_type":"text/x-python","patch_set":1,"id":"dfbec78f_cf760471","line":3159,"updated":"2019-05-15 21:14:58.000000000","message":"Related commit, from 6 years ago:\n\nhttps://github.com/openstack/nova/commit/86031940b313532606449c400bca64707be1797a","commit_id":"99ce5eb6cde6afcb73feeb23dd7a94945a47a03f"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ea1c880df7bf1af5dd19d14d0b0759758b549f32","unresolved":false,"context_lines":[{"line_number":3156,"context_line":"                    raise"},{"line_number":3157,"context_line":"                else:"},{"line_number":3158,"context_line":"                    LOG.info(\u0027Skipping quiescing instance: %(reason)s.\u0027,"},{"line_number":3159,"context_line":"                             {\u0027reason\u0027: err.format_message()},"},{"line_number":3160,"context_line":"                             instance\u003dinstance)"},{"line_number":3161,"context_line":"            # NOTE(tasker): discovered that an uncaught exception could occur"},{"line_number":3162,"context_line":"            #               after the instance has been frozen. catch and thaw."}],"source_content_type":"text/x-python","patch_set":1,"id":"dfbec78f_cf4124ab","line":3159,"in_reply_to":"dfbec78f_4f92144e","updated":"2019-05-15 21:38:32.000000000","message":"Dangit, good catch. My initial attempt at dealing with this was to truncate the message on \\n but eventually found format_message method.\n\nNow I\u0027m wondering, should I just truncate the message, or is there a less ugly way? If we exclude NotImplementedError for calling format_message, then it would log a full traceback itself.","commit_id":"99ce5eb6cde6afcb73feeb23dd7a94945a47a03f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e8a7fd17a2e7b55824b43542ed4b5e63b00bb99d","unresolved":false,"context_lines":[{"line_number":3156,"context_line":"                    raise"},{"line_number":3157,"context_line":"                else:"},{"line_number":3158,"context_line":"                    LOG.info(\u0027Skipping quiescing instance: %(reason)s.\u0027,"},{"line_number":3159,"context_line":"                             {\u0027reason\u0027: err.format_message()},"},{"line_number":3160,"context_line":"                             instance\u003dinstance)"},{"line_number":3161,"context_line":"            # NOTE(tasker): discovered that an uncaught exception could occur"},{"line_number":3162,"context_line":"            #               after the instance has been frozen. catch and thaw."}],"source_content_type":"text/x-python","patch_set":1,"id":"dfbec78f_4f92144e","line":3159,"in_reply_to":"dfbec78f_cf760471","updated":"2019-05-15 21:27:55.000000000","message":"Oh wait this won\u0027t work for NotImplementedError...","commit_id":"99ce5eb6cde6afcb73feeb23dd7a94945a47a03f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"1dc7695b555ceced9af8e4a22f7aa7c0990ca151","unresolved":false,"context_lines":[{"line_number":3151,"context_line":"            except (exception.InstanceQuiesceNotSupported,"},{"line_number":3152,"context_line":"                    exception.QemuGuestAgentNotEnabled,"},{"line_number":3153,"context_line":"                    exception.NovaException, NotImplementedError) as err:"},{"line_number":3154,"context_line":"                if strutils.bool_from_string(instance.system_metadata.get("},{"line_number":3155,"context_line":"                        \u0027image_os_require_quiesce\u0027)):"},{"line_number":3156,"context_line":"                    raise"},{"line_number":3157,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"dfbec78f_2f6fa0fc","line":3154,"updated":"2019-05-15 22:03:47.000000000","message":"unrelated: should use save_and_reraise here","commit_id":"d73c1279e7745e941f02d44dbd554af1b9fc1e66"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b80826318fbddef3e84c2d0d5838fba32ab2173","unresolved":false,"context_lines":[{"line_number":3154,"context_line":"                if strutils.bool_from_string(instance.system_metadata.get("},{"line_number":3155,"context_line":"                        \u0027image_os_require_quiesce\u0027)):"},{"line_number":3156,"context_line":"                    raise"},{"line_number":3157,"context_line":"                else:"},{"line_number":3158,"context_line":"                    if isinstance(exception.NovaException, err):"},{"line_number":3159,"context_line":"                        msg \u003d err.format_message()"},{"line_number":3160,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"dfbec78f_cf10445a","line":3157,"updated":"2019-05-15 22:10:01.000000000","message":"We can nix this else to help with the nest party going on. If we raised in the if block we don\u0027t get here anyway.","commit_id":"d73c1279e7745e941f02d44dbd554af1b9fc1e66"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"1dc7695b555ceced9af8e4a22f7aa7c0990ca151","unresolved":false,"context_lines":[{"line_number":3161,"context_line":"                        # *_Remote exceptions from oslo.messaging append the"},{"line_number":3162,"context_line":"                        # full traceback to an overidden __str__ method, so we"},{"line_number":3163,"context_line":"                        # must truncate if we do not want to log the traceback."},{"line_number":3164,"context_line":"                        msg \u003d six.text_type(err).split(\u0027\\n\u0027, 1)[0]"},{"line_number":3165,"context_line":"                    LOG.info(\u0027Skipping quiescing instance: %(reason)s.\u0027,"},{"line_number":3166,"context_line":"                             {\u0027reason\u0027: msg},"},{"line_number":3167,"context_line":"                             instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"dfbec78f_2f3d60dc","line":3164,"updated":"2019-05-15 22:03:47.000000000","message":"Yeah, this is pretty icky. And err.args[0] only works if NotImplementedError got an argument, which I guess it usually doesn\u0027t. What about\n\n msg \u003d err.args[0] if err.args else \u0027NotImplementedError\u0027","commit_id":"d73c1279e7745e941f02d44dbd554af1b9fc1e66"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b80826318fbddef3e84c2d0d5838fba32ab2173","unresolved":false,"context_lines":[{"line_number":3161,"context_line":"                        # *_Remote exceptions from oslo.messaging append the"},{"line_number":3162,"context_line":"                        # full traceback to an overidden __str__ method, so we"},{"line_number":3163,"context_line":"                        # must truncate if we do not want to log the traceback."},{"line_number":3164,"context_line":"                        msg \u003d six.text_type(err).split(\u0027\\n\u0027, 1)[0]"},{"line_number":3165,"context_line":"                    LOG.info(\u0027Skipping quiescing instance: %(reason)s.\u0027,"},{"line_number":3166,"context_line":"                             {\u0027reason\u0027: msg},"},{"line_number":3167,"context_line":"                             instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"dfbec78f_6f15973f","line":3164,"in_reply_to":"dfbec78f_2f3d60dc","updated":"2019-05-15 22:10:01.000000000","message":"Or, just do:\n\nif isinstance(exception.NovaException, err):\n  LOG.info(\u0027Skipping quiescing instance: %(reason)s.\u0027,\n           {\u0027reason\u0027: err.format_message()},\n           instance\u003dinstance)\nelse:\n  LOG.info(\u0027Skipping quiescing instance since the operation \u0027\n           \u0027is not supported by the underlying compute driver.\u0027,\n           instance\u003dinstance)","commit_id":"d73c1279e7745e941f02d44dbd554af1b9fc1e66"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"4563096b00255b4c5b1915fc5fe9ca409127affc","unresolved":false,"context_lines":[{"line_number":3161,"context_line":"                        # *_Remote exceptions from oslo.messaging append the"},{"line_number":3162,"context_line":"                        # full traceback to an overidden __str__ method, so we"},{"line_number":3163,"context_line":"                        # must truncate if we do not want to log the traceback."},{"line_number":3164,"context_line":"                        msg \u003d six.text_type(err).split(\u0027\\n\u0027, 1)[0]"},{"line_number":3165,"context_line":"                    LOG.info(\u0027Skipping quiescing instance: %(reason)s.\u0027,"},{"line_number":3166,"context_line":"                             {\u0027reason\u0027: msg},"},{"line_number":3167,"context_line":"                             instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"dfbec78f_8f39ebd7","line":3164,"in_reply_to":"dfbec78f_2f3d60dc","updated":"2019-05-15 22:13:54.000000000","message":"Yeah... seems kind of weird to reimplement format_message here though.","commit_id":"d73c1279e7745e941f02d44dbd554af1b9fc1e66"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"4563096b00255b4c5b1915fc5fe9ca409127affc","unresolved":false,"context_lines":[{"line_number":3161,"context_line":"                        # *_Remote exceptions from oslo.messaging append the"},{"line_number":3162,"context_line":"                        # full traceback to an overidden __str__ method, so we"},{"line_number":3163,"context_line":"                        # must truncate if we do not want to log the traceback."},{"line_number":3164,"context_line":"                        msg \u003d six.text_type(err).split(\u0027\\n\u0027, 1)[0]"},{"line_number":3165,"context_line":"                    LOG.info(\u0027Skipping quiescing instance: %(reason)s.\u0027,"},{"line_number":3166,"context_line":"                             {\u0027reason\u0027: msg},"},{"line_number":3167,"context_line":"                             instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"dfbec78f_ef4f4768","line":3164,"in_reply_to":"dfbec78f_6f15973f","updated":"2019-05-15 22:13:54.000000000","message":"This is more along the lines of what I was thinking.","commit_id":"d73c1279e7745e941f02d44dbd554af1b9fc1e66"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a091b7021430633049c1c3f3c2b995b83ccb77ca","unresolved":false,"context_lines":[{"line_number":3161,"context_line":"                        # *_Remote exceptions from oslo.messaging append the"},{"line_number":3162,"context_line":"                        # full traceback to an overidden __str__ method, so we"},{"line_number":3163,"context_line":"                        # must truncate if we do not want to log the traceback."},{"line_number":3164,"context_line":"                        msg \u003d six.text_type(err).split(\u0027\\n\u0027, 1)[0]"},{"line_number":3165,"context_line":"                    LOG.info(\u0027Skipping quiescing instance: %(reason)s.\u0027,"},{"line_number":3166,"context_line":"                             {\u0027reason\u0027: msg},"},{"line_number":3167,"context_line":"                             instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"dfbec78f_4fe0d326","line":3164,"in_reply_to":"dfbec78f_8f39ebd7","updated":"2019-05-15 22:21:27.000000000","message":"\u003e Yeah... seems kind of weird to reimplement format_message here\n \u003e though.\n\nWhat seems weird to me is the existence of the method in the first place, considering it\u0027s 8c longer (and an extra call stack) vs inlining the thing. Shrug.","commit_id":"d73c1279e7745e941f02d44dbd554af1b9fc1e66"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"31f4f495f1d216d6d95222a6ecd4681cb36e0dad","unresolved":false,"context_lines":[{"line_number":3155,"context_line":"                        \u0027image_os_require_quiesce\u0027)):"},{"line_number":3156,"context_line":"                    raise"},{"line_number":3157,"context_line":""},{"line_number":3158,"context_line":"                if isinstance(exception.NovaException, err):"},{"line_number":3159,"context_line":"                    LOG.info(\u0027Skipping quiescing instance: %(reason)s.\u0027,"},{"line_number":3160,"context_line":"                             {\u0027reason\u0027: err.format_message()},"},{"line_number":3161,"context_line":"                             instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":3,"id":"dfbec78f_726fc02a","line":3158,"range":{"start_line":3158,"start_character":19,"end_line":3158,"end_character":59},"updated":"2019-05-16 00:51:26.000000000","message":"isinstance(err, exception.NovaException)","commit_id":"7087591699e525a2183561099c73fe80fb85b0c7"}]}
