)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e505984afff6eac8376fb0e73e23547681ba18f7","unresolved":false,"context_lines":[{"line_number":10,"context_line":"to get last length lines from specified offset."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I048ca597b3338d6cc49b0563a4e60fba246dcee7"},{"line_number":13,"context_line":"Implements: I1783ce64619196af7741e46e7abfd8afbe1a3b67"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":46,"id":"3aaa91ec_524474b6","line":13,"updated":"2016-07-01 13:43:37.000000000","message":"This should be:\n\nImplements blueprint console-log-offset\n\nThis change wasn\u0027t being tracked at all in launchpad so I literally thought no work had been started on this blueprint all release and now we\u0027re at non-priority feature freeze.","commit_id":"c9d07008b9103527682973139b546e020811634a"}],"nova/api/openstack/compute/legacy_v2/contrib/console_output.py":[{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"504c68299adf470ce6e2350fee4dca319548979b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2011 OpenStack Foundation"},{"line_number":2,"context_line":"# Copyright 2011 Grid Dynamics"},{"line_number":3,"context_line":"# Copyright 2011 Eldar Nugaev, Kirill Shileev, Ilya Alekseyev"},{"line_number":4,"context_line":"#"},{"line_number":5,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":6,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":47,"id":"dada55a8_07599b5a","line":3,"range":{"start_line":1,"start_character":0,"end_line":3,"end_character":61},"updated":"2016-07-25 22:30:37.000000000","message":"Oh, this module is not necessary at all now because we have already removed legacy v2 API code.","commit_id":"8fa944da45321ddba3f90ba2e0430df6fa0fe1dc"}],"nova/api/openstack/compute/schemas/console_output.py":[{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"504c68299adf470ce6e2350fee4dca319548979b","unresolved":false,"context_lines":[{"line_number":27,"context_line":"                    # Should remove in the future with a microversion"},{"line_number":28,"context_line":"                    \u0027minimum\u0027: -1,"},{"line_number":29,"context_line":"                },"},{"line_number":30,"context_line":"                \u0027offset\u0027: {"},{"line_number":31,"context_line":"                    \u0027type\u0027: [\u0027integer\u0027, \u0027string\u0027, \u0027null\u0027],"},{"line_number":32,"context_line":"                    \u0027pattern\u0027: \u0027^-?[0-9]+$\u0027,"},{"line_number":33,"context_line":"                    \u0027minimum\u0027: 0,"},{"line_number":34,"context_line":"                },"},{"line_number":35,"context_line":"            },"},{"line_number":36,"context_line":"            \u0027additionalProperties\u0027: False,"},{"line_number":37,"context_line":"        },"}],"source_content_type":"text/x-python","patch_set":47,"id":"dada55a8_fa4b3e57","line":34,"range":{"start_line":30,"start_character":26,"end_line":34,"end_character":18},"updated":"2016-07-25 22:30:37.000000000","message":"I think null is unnecessary for this parameter.\nI guess this null came from the above \"length\" but the null is just for backwards compatibility as the comment.\nThen we can use parameter_types.non_negative_integer here.","commit_id":"8fa944da45321ddba3f90ba2e0430df6fa0fe1dc"}],"nova/compute/manager.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fceb730e6e6fa5217bfa9243df9e929cbf746aea","unresolved":false,"context_lines":[{"line_number":4448,"context_line":"                                   exception.InstanceNotFound)"},{"line_number":4449,"context_line":"    @wrap_exception()"},{"line_number":4450,"context_line":"    @wrap_instance_fault"},{"line_number":4451,"context_line":"    def get_console_output(self, context, instance, tail_length, offset\u003d0):"},{"line_number":4452,"context_line":"        \"\"\"Send the console output for the given instance.\"\"\""},{"line_number":4453,"context_line":"        context \u003d context.elevated()"},{"line_number":4454,"context_line":"        LOG.info(_LI(\"Get console output\"), context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_d299bbc5","line":4451,"updated":"2016-03-18 19:53:02.000000000","message":"It would be appreciated to add a docstring describing the new offset parameter here. Also, it\u0027s not clear whether this is an offset in bytes or *lines* into the console log file. I\u0027d recommend changing the parameter name actually to \"seek_lines\" or \"offset_lines\" to make it clearer that the parameter is indicating the number of lines to seek into the console log file before generating output along with the tail_length parameter.","commit_id":"509202754fac3846e95742428e0855c067a60c80"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fceb730e6e6fa5217bfa9243df9e929cbf746aea","unresolved":false,"context_lines":[{"line_number":4452,"context_line":"        \"\"\"Send the console output for the given instance.\"\"\""},{"line_number":4453,"context_line":"        context \u003d context.elevated()"},{"line_number":4454,"context_line":"        LOG.info(_LI(\"Get console output\"), context\u003dcontext,"},{"line_number":4455,"context_line":"                 instance\u003dinstance)"},{"line_number":4456,"context_line":"        output \u003d self.driver.get_console_output(context, instance)"},{"line_number":4457,"context_line":""},{"line_number":4458,"context_line":"        if type(output) is six.text_type:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_b294ef8a","line":4455,"updated":"2016-03-18 19:53:02.000000000","message":"Gleb, when submitting patches, please make sure to keep style-only or whitespace-only changes like this in a separate patch. It makes reviewing harder when reviewers need to determine why each line changed.","commit_id":"509202754fac3846e95742428e0855c067a60c80"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fceb730e6e6fa5217bfa9243df9e929cbf746aea","unresolved":false,"context_lines":[{"line_number":4480,"context_line":"        else:"},{"line_number":4481,"context_line":"            if offset:"},{"line_number":4482,"context_line":"                return b\u0027\\n\u0027.join(log.split(b\u0027\\n\u0027)"},{"line_number":4483,"context_line":"                                  [-int(length) - offset: -offset])"},{"line_number":4484,"context_line":"            else:"},{"line_number":4485,"context_line":"                return b\u0027\\n\u0027.join(log.split(b\u0027\\n\u0027)[-int(length):])"},{"line_number":4486,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_12904394","line":4483,"updated":"2016-03-18 19:53:02.000000000","message":"Might be a little clearer to do:\n\n if offset:\n     seek_to \u003d int(length) - offset\n     return b\u0027\\n\u0027.join(log.split(b\u0027\\n\u0027)[-seek_to:-offset]","commit_id":"509202754fac3846e95742428e0855c067a60c80"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"504c68299adf470ce6e2350fee4dca319548979b","unresolved":false,"context_lines":[{"line_number":4356,"context_line":"        try:"},{"line_number":4357,"context_line":"            offset \u003d int(offset)"},{"line_number":4358,"context_line":"        except ValueError:"},{"line_number":4359,"context_line":"            offset \u003d 0"},{"line_number":4360,"context_line":""},{"line_number":4361,"context_line":"        if length \u003d\u003d 0:"},{"line_number":4362,"context_line":"            return b\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":47,"id":"dada55a8_fae7be3d","line":4359,"updated":"2016-07-25 22:30:37.000000000","message":"I don\u0027t think this change is necessary(line 4356-4359) because the json-schema blocks the invalid parameter value.","commit_id":"8fa944da45321ddba3f90ba2e0430df6fa0fe1dc"}],"nova/compute/rpcapi.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fceb730e6e6fa5217bfa9243df9e929cbf746aea","unresolved":false,"context_lines":[{"line_number":341,"context_line":"        \u0027juno\u0027: \u00273.35\u0027,"},{"line_number":342,"context_line":"        \u0027kilo\u0027: \u00274.0\u0027,"},{"line_number":343,"context_line":"        \u0027liberty\u0027: \u00274.5\u0027,"},{"line_number":344,"context_line":"        \u0027mitaka\u0027: \u00274.12\u0027,"},{"line_number":345,"context_line":"    }"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"    def __init__(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_f28af762","line":344,"updated":"2016-03-18 19:53:02.000000000","message":"The above line should not change. This patch is a new feature and therefore should go against Newton (which is the current master). Mitaka\u0027s RPC version is now essentially frozen.","commit_id":"509202754fac3846e95742428e0855c067a60c80"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fceb730e6e6fa5217bfa9243df9e929cbf746aea","unresolved":false,"context_lines":[{"line_number":3276,"context_line":"            output \u003d self.compute.get_console_output(self.context,"},{"line_number":3277,"context_line":"                    instance\u003dinstance, tail_length\u003dNone)"},{"line_number":3278,"context_line":"            self.assertEqual(output, b\u0027Hello.\u0027)"},{"line_number":3279,"context_line":"            self.compute.terminate_instance(self.context, instance, [], [])"},{"line_number":3280,"context_line":""},{"line_number":3281,"context_line":"    def test_console_output_tail(self):"},{"line_number":3282,"context_line":"        # Make sure we can get console output from instance."}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_52ec8b29","line":3279,"updated":"2016-03-18 19:53:02.000000000","message":"I actually have no idea what the above unit test is testing that is different from test_console_output(), but whatever...","commit_id":"509202754fac3846e95742428e0855c067a60c80"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fceb730e6e6fa5217bfa9243df9e929cbf746aea","unresolved":false,"context_lines":[{"line_number":3291,"context_line":""},{"line_number":3292,"context_line":"    def test_console_output_offset(self):"},{"line_number":3293,"context_line":"        # Make sure we can get console output from instance."},{"line_number":3294,"context_line":""},{"line_number":3295,"context_line":"        instance \u003d self._create_fake_instance_obj()"},{"line_number":3296,"context_line":"        self.compute.build_and_run_instance(self.context,"},{"line_number":3297,"context_line":"                                            instance,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_32ef3f1f","line":3294,"updated":"2016-03-18 19:53:02.000000000","message":"Remove above two lines. It\u0027s obvious what we\u0027re testing from the name of the test method :)","commit_id":"509202754fac3846e95742428e0855c067a60c80"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fceb730e6e6fa5217bfa9243df9e929cbf746aea","unresolved":false,"context_lines":[{"line_number":3298,"context_line":"                                            {},"},{"line_number":3299,"context_line":"                                            {},"},{"line_number":3300,"context_line":"                                            {},"},{"line_number":3301,"context_line":"                                            block_device_mapping\u003d[])"},{"line_number":3302,"context_line":""},{"line_number":3303,"context_line":"        output \u003d self.compute.get_console_output(self.context,"},{"line_number":3304,"context_line":"                                                 instance\u003dinstance,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_92f29304","line":3301,"updated":"2016-03-18 19:53:02.000000000","message":"I know you were just copy-pasting code from the above unit test, but having the unit test of the console output actually build and run an instance seems like way too large of a test surface area for just testing the console output API call. I would welcome a *future* patch from you that uses mocks and reduces the surface area of the unit tests to *just* the get_console_output() method of the manager.","commit_id":"509202754fac3846e95742428e0855c067a60c80"}]}
