)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d022006aac35a0bc65c5f33deff5c3b9bb02b621","unresolved":false,"context_lines":[{"line_number":462,"context_line":"            # deleted before it actually got created.  This should"},{"line_number":463,"context_line":"            # be fixed once we have no-db-messaging"},{"line_number":464,"context_line":"            pass"},{"line_number":465,"context_line":"        except:"},{"line_number":466,"context_line":"            error \u003d sys.exc_info()[0]"},{"line_number":467,"context_line":"            with utils.save_and_reraise_exception():"},{"line_number":468,"context_line":"                LOG.exception(_(\"Instance \u0027%(instance_id)s\u0027 failed to spawn. \""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F4mY%3D","line":465,"updated":"2011-11-03 21:20:33.000000000","message":"I\u0027d prefer \"except Exception as error:\"; that\u0027s the style we *should* be using, and getting the exception from sys.exc_info()[0] would actually get you the type (you mean sys.exc_info()[1], but don\u0027t do it that way).","commit_id":"d946ceb420bdae2ee3f1a274c310fdd7bad947a0"},{"author":{"_account_id":706,"name":"Brian Lamar","email":"brian.lamar@rackspace.com","username":"blamar"},"change_message_id":"6f408a6c3c9cdc38e8db7b4be8b3bc977a66e3bf","unresolved":false,"context_lines":[{"line_number":465,"context_line":"        except Exception as error:"},{"line_number":466,"context_line":"            with utils.save_and_reraise_exception():"},{"line_number":467,"context_line":"                LOG.exception(_(\"Instance \u0027%(instance_id)s\u0027 failed to spawn. \""},{"line_number":468,"context_line":"                                \"Details: %(error)s\") % locals())"},{"line_number":469,"context_line":"                self._instance_update(context,"},{"line_number":470,"context_line":"                                  instance_id,"},{"line_number":471,"context_line":"                                  vm_state\u003dvm_states.ERROR)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F4jw%3D","line":468,"updated":"2011-11-04 03:37:18.000000000","message":"This exception message was made explicitly to be wrapped around self.driver.spawn(). In my opinion we should be having more try/except blocks and not fewer.\n\nIt\u0027s easier to debug a certain situation when you have LOG messages closer to where the actual error occurs. My rule is normally to only encompass a single line of code in a try/except block in the ideal case. Of course, that\u0027s not always possible but going to extremes sometimes helps me stop...rambling.","commit_id":"58ac8484ab43c79fe514a0b6862b6fd48583514c"},{"author":{"_account_id":706,"name":"Brian Lamar","email":"brian.lamar@rackspace.com","username":"blamar"},"change_message_id":"170288fb7470d9fcfcc7f7be0934bfa12ad53482","unresolved":false,"context_lines":[{"line_number":413,"context_line":"        @contextlib.contextmanager"},{"line_number":414,"context_line":"        def _logging_error(instance_id, message):"},{"line_number":415,"context_line":"            try:"},{"line_number":416,"context_line":"                yield"},{"line_number":417,"context_line":"            except Exception as error:"},{"line_number":418,"context_line":"                with utils.save_and_reraise_exception():"},{"line_number":419,"context_line":"                    LOG.exception(_(\"Instance \u0027%(instance_id)s\u0027 \""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F32E%3D","line":416,"updated":"2011-11-07 20:13:16.000000000","message":"I\u0027m confused about what this is doing. It seems to me that this could never generate an exception, but I might not be thinking about the particulars of what contexmanager does...\n\nIt seems like this method should be a function decorator which does:\n\ntry:\n    func(*args, **kwargs)\nexcept Exception as error:\n   with utils.save_and_reraise_exception():\n        LOG.exception(_(\"Instance \u0027%(instance_id)s\u0027 \"\n                        \"failed %(message)s.\") % locals())\n\nThen use it like:\n\n    @handle_errors(\"network setup\")\n    def _make_network_info():\n\nand \n\n    @handle_errors(\"block device setup\")\n    def _make_block_device_info():\n\netc.\n\nAll this confusion might be my lack of understanding the contextlib though, because I\u0027ll admit I haven\u0027t used it a lot :)","commit_id":"e2517798ab0780d6de1546bf831e4d5edc304e15"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"93739287547b1f13027b7b7fcf06f67001f3d183","unresolved":false,"context_lines":[{"line_number":413,"context_line":"        @contextlib.contextmanager"},{"line_number":414,"context_line":"        def _logging_error(instance_id, message):"},{"line_number":415,"context_line":"            try:"},{"line_number":416,"context_line":"                yield"},{"line_number":417,"context_line":"            except Exception as error:"},{"line_number":418,"context_line":"                with utils.save_and_reraise_exception():"},{"line_number":419,"context_line":"                    LOG.exception(_(\"Instance \u0027%(instance_id)s\u0027 \""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F31s%3D","line":416,"in_reply_to":"AAAACX%2F%2F318%3D","updated":"2011-11-07 20:25:59.000000000","message":"The way that contextlib.contextmanager works is that it expects the function to be a generator function; the part before yield is called by __enter__() of the context manager, and the part after is called by __exit__().  If an exception was raised, then that exception will be raised within the generator, as if by the yield statement itself.","commit_id":"e2517798ab0780d6de1546bf831e4d5edc304e15"},{"author":{"_account_id":1456,"name":"Aaron Lee","email":"aaron.lee@rackspace.com","username":"aaron-lee"},"change_message_id":"2a422c45f01d7832f6260629299f4663c20054c4","unresolved":false,"context_lines":[{"line_number":413,"context_line":"        @contextlib.contextmanager"},{"line_number":414,"context_line":"        def _logging_error(instance_id, message):"},{"line_number":415,"context_line":"            try:"},{"line_number":416,"context_line":"                yield"},{"line_number":417,"context_line":"            except Exception as error:"},{"line_number":418,"context_line":"                with utils.save_and_reraise_exception():"},{"line_number":419,"context_line":"                    LOG.exception(_(\"Instance \u0027%(instance_id)s\u0027 \""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F318%3D","line":416,"in_reply_to":"AAAACX%2F%2F32E%3D","updated":"2011-11-07 20:18:51.000000000","message":"This is a more specific case of save_and_reraise_exception(). It prints a more specific error message, and then raises to a more generic handler that takes care of the cleanup.","commit_id":"e2517798ab0780d6de1546bf831e4d5edc304e15"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"8f667ed835a3b789536afcbfe4bfa58d55c7de41","unresolved":false,"context_lines":[{"line_number":472,"context_line":"                                  launched_at\u003dutils.utcnow())"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"            usage_info \u003d utils.usage_from_instance(instance)"},{"line_number":475,"context_line":"            notifier.notify(\u0027compute.%s\u0027 % self.host,"},{"line_number":476,"context_line":"                                \u0027compute.instance.create\u0027,"},{"line_number":477,"context_line":"                                notifier.INFO, usage_info)"},{"line_number":478,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAACX%2F%2F3zs%3D","line":475,"updated":"2011-11-07 22:09:16.000000000","message":"Not a big deal, but why this whitespace change?","commit_id":"e2517798ab0780d6de1546bf831e4d5edc304e15"}]}
