)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"84dc831581793fa36d171bd8a114825524de14db","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Conflicts:"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"\tnova/api/ec2/cloud.py"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Change-Id: Icaa647705d6d4cbc3b784ac719c35eb54ebae9d2"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAACX%2F%2F9aw%3D","line":23,"updated":"2011-10-07 00:19:37.000000000","message":"This doesn\u0027t need to be in the commit message","commit_id":"ffb1b404ebc9a0ea64aaa9f602f374d8075a25ca"}],"nova/api/ec2/metadatarequesthandler.py":[{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"84dc831581793fa36d171bd8a114825524de14db","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"class MetadataBuilder(object):"},{"line_number":116,"context_line":"    \"\"\"JIT lookup of instance data for metadata requests."},{"line_number":117,"context_line":"       "},{"line_number":118,"context_line":"    Calling `get(path)` returns a dict if it isn\u0027t a bottom level object,"},{"line_number":119,"context_line":"    None if the path is invalid, or a callback if we need to get data"},{"line_number":120,"context_line":"    from the current instance."}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F9a0%3D","line":117,"updated":"2011-10-07 00:19:37.000000000","message":"Don\u0027t forget to remove the trailing whitespace","commit_id":"ffb1b404ebc9a0ea64aaa9f602f374d8075a25ca"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"5d48a7d1a0f37be7e5740b4183b971a8a5a037c6","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        callback \u003d self.builder.get(path)"},{"line_number":95,"context_line":"        if callback is None:"},{"line_number":96,"context_line":"            return webob.exc.HTTPNotFound()"},{"line_number":97,"context_line":"        if isinstance(callback, types.FunctionType):"},{"line_number":98,"context_line":"            instance \u003d self.instance_from_remote_address(remote_address)"},{"line_number":99,"context_line":"            if instance is None:"},{"line_number":100,"context_line":"                LOG.error(_(\u0027Failed to get metadata for ip: %s\u0027),"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F9Zs%3D","line":97,"updated":"2011-10-07 16:01:35.000000000","message":"I\u0027d suggest using callable() to determine if the object can be called instead of assuming it can only possibly be a function.\n\nSpeaking of which, when would callback ever not be callable? This check seems unnecessary.","commit_id":"47ea97b7eb69973119b4f35863e5953d33d77db6"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"5d48a7d1a0f37be7e5740b4183b971a8a5a037c6","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                    root \u003d root[part]"},{"line_number":185,"context_line":"                else:"},{"line_number":186,"context_line":"                    root \u003d None"},{"line_number":187,"context_line":"            if isinstance(root, types.FunctionType):"},{"line_number":188,"context_line":"                # NOTE(todd): see how /latest/meta-data/public-keys/0 works"},{"line_number":189,"context_line":"                # so stop here, run callback, then finish lookup"},{"line_number":190,"context_line":"                post_parts \u003d parts"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F9Zo%3D","line":187,"updated":"2011-10-07 16:01:35.000000000","message":"Same thing with callable()","commit_id":"47ea97b7eb69973119b4f35863e5953d33d77db6"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"5d48a7d1a0f37be7e5740b4183b971a8a5a037c6","unresolved":false,"context_lines":[{"line_number":189,"context_line":"                # so stop here, run callback, then finish lookup"},{"line_number":190,"context_line":"                post_parts \u003d parts"},{"line_number":191,"context_line":"                parts \u003d None"},{"line_number":192,"context_line":"        if isinstance(root, types.FunctionType):"},{"line_number":193,"context_line":"            if post_parts:"},{"line_number":194,"context_line":"                return lambda inst: self.intermediate(root, inst, post_parts)"},{"line_number":195,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F9Zk%3D","line":192,"updated":"2011-10-07 16:01:35.000000000","message":"Same thing with callable()","commit_id":"47ea97b7eb69973119b4f35863e5953d33d77db6"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"5d48a7d1a0f37be7e5740b4183b971a8a5a037c6","unresolved":false,"context_lines":[{"line_number":210,"context_line":"    def user_data(self, instance):"},{"line_number":211,"context_line":"        return base64.b64decode(instance[\u0027user_data\u0027])"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def ami_id(self, instance):"},{"line_number":214,"context_line":"        image_id \u003d instance[\u0027image_id\u0027]"},{"line_number":215,"context_line":"        template \u003d \u0027ami-%08x\u0027"},{"line_number":216,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F9Zg%3D","line":213,"updated":"2011-10-07 16:01:35.000000000","message":"Why not use self.cc.image_ec2_id()?","commit_id":"47ea97b7eb69973119b4f35863e5953d33d77db6"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"5d48a7d1a0f37be7e5740b4183b971a8a5a037c6","unresolved":false,"context_lines":[{"line_number":220,"context_line":"            # in place, this wont be necessary"},{"line_number":221,"context_line":"            return \"ami-00000000\""},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def kernel_id(self, instance):"},{"line_number":224,"context_line":"        image_id \u003d instance[\u0027kernel_id\u0027]"},{"line_number":225,"context_line":"        template \u003d \u0027ami-%08x\u0027"},{"line_number":226,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F9Zc%3D","line":223,"updated":"2011-10-07 16:01:35.000000000","message":"Why not use self.cc.image_ec2_id()?","commit_id":"47ea97b7eb69973119b4f35863e5953d33d77db6"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"5d48a7d1a0f37be7e5740b4183b971a8a5a037c6","unresolved":false,"context_lines":[{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def kernel_id(self, instance):"},{"line_number":224,"context_line":"        image_id \u003d instance[\u0027kernel_id\u0027]"},{"line_number":225,"context_line":"        template \u003d \u0027ami-%08x\u0027"},{"line_number":226,"context_line":"        try:"},{"line_number":227,"context_line":"            return ec2utils.id_to_ec2_id(int(image_id), template\u003dtemplate)"},{"line_number":228,"context_line":"        except ValueError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F9ZY%3D","line":225,"updated":"2011-10-07 16:01:35.000000000","message":"Shouldn\u0027t this be \u0027aki\u0027?","commit_id":"47ea97b7eb69973119b4f35863e5953d33d77db6"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"5d48a7d1a0f37be7e5740b4183b971a8a5a037c6","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            # in place, this wont be necessary"},{"line_number":231,"context_line":"            return \"ami-00000000\""},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def ramdisk_id(self, instance):"},{"line_number":234,"context_line":"        image_id \u003d instance[\u0027image_id\u0027]"},{"line_number":235,"context_line":"        template \u003d \u0027ami-%08x\u0027"},{"line_number":236,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F9ZQ%3D","line":233,"updated":"2011-10-07 16:01:35.000000000","message":"Why not use self.cc.image_ec2_id()?","commit_id":"47ea97b7eb69973119b4f35863e5953d33d77db6"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"5d48a7d1a0f37be7e5740b4183b971a8a5a037c6","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def ramdisk_id(self, instance):"},{"line_number":234,"context_line":"        image_id \u003d instance[\u0027image_id\u0027]"},{"line_number":235,"context_line":"        template \u003d \u0027ami-%08x\u0027"},{"line_number":236,"context_line":"        try:"},{"line_number":237,"context_line":"            return ec2utils.id_to_ec2_id(int(image_id), template\u003dtemplate)"},{"line_number":238,"context_line":"        except ValueError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F9ZU%3D","line":235,"updated":"2011-10-07 16:01:35.000000000","message":"Shouldn\u0027t this be \u0027ari\u0027?","commit_id":"47ea97b7eb69973119b4f35863e5953d33d77db6"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"5d48a7d1a0f37be7e5740b4183b971a8a5a037c6","unresolved":false,"context_lines":[{"line_number":243,"context_line":"    def launch_index(self, instance):"},{"line_number":244,"context_line":"        return instance[\u0027launch_index\u0027]"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    def dev_map(self, instance):"},{"line_number":247,"context_line":"        root_device_name \u003d instance[\u0027root_device_name\u0027]"},{"line_number":248,"context_line":"        if root_device_name is None:"},{"line_number":249,"context_line":"            return cloud._DEFAULT_MAPPINGS"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F9ZI%3D","line":246,"updated":"2011-10-07 16:01:35.000000000","message":"This appears to be mostly duplicated with nova.api.ec2.cloud:_format_instance_mapping. Are two implementations necessary?","commit_id":"47ea97b7eb69973119b4f35863e5953d33d77db6"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"5d48a7d1a0f37be7e5740b4183b971a8a5a037c6","unresolved":false,"context_lines":[{"line_number":369,"context_line":"                \u0027kernel-id\u0027: kernel_id,"},{"line_number":370,"context_line":"                \u0027ramdisk-id\u0027: ramdisk_id,"},{"line_number":371,"context_line":"                \u0027mpi\u0027: mpi}}"},{"line_number":372,"context_line":"        # TODO(vish): ancestor-ami-ids, product-codes"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAACX%2F%2F9ZM%3D","line":372,"updated":"2011-10-07 16:01:35.000000000","message":"Where are these TODO lines coming from? I don\u0027t see them in the rest of the code and Vish doesn\u0027t appear to be an author on this branch.","commit_id":"47ea97b7eb69973119b4f35863e5953d33d77db6"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"c10f2f824e9b39cea48e11a7a87bca3f102063d9","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from nova import utils"},{"line_number":27,"context_line":"from nova import wsgi"},{"line_number":28,"context_line":"from nova.api.ec2 import cloud"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"LOG \u003d logging.getLogger(\u0027nova.api.ec2.metadata\u0027)"},{"line_number":32,"context_line":"FLAGS \u003d flags.FLAGS"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAACX%2F%2F8us%3D","side":"PARENT","line":29,"updated":"2011-10-13 04:29:43.000000000","message":"Sorry, missed this the first time.  Been paying a little closer attention to HACKING violations now.  These 2 additions at the end violate it.  If you can fix nova.api.ec2 at the same time, that\u0027d be wonderful.   And a recent change to HACKING says those webob imports should be in their own block now, too.","commit_id":"c0cf874acb3a67371ebbd5abbd274f61ffa09396"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"e7c53c8c5bf147a692b8fda670e161ffbbeb8990","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        try:"},{"line_number":94,"context_line":"            instances \u003d self.compute_api.get_all(adm, search_opts\u003dsearch_opts)"},{"line_number":95,"context_line":"        except exception.NotFound:"},{"line_number":96,"context_line":"            return None"},{"line_number":97,"context_line":"        return db.instance_get(adm, instances[0][\u0027id\u0027])"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    @webob.dec.wsgify(RequestClass\u003dwsgi.Request)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAACX%2F%2F77U%3D","line":96,"updated":"2011-10-18 23:54:31.000000000","message":"Looking at Dan\u0027s paste... I can see that you can ditch the try/except... and is there a specific reason for the extra instance_get() in here?  I\u0027d think this would do:\n\ninstances \u003d self.compute_api.get_all(...)\nif not instances:\n    return None\nreturn instances[0]","commit_id":"11f5872f3f9744442a263a18fae425fe715e0cb9"}],"nova/tests/test_metadata.py":[{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"84dc831581793fa36d171bd8a114825524de14db","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        response \u003d request.get_response(self.app)"},{"line_number":160,"context_line":"        self.assertEqual(response.status_int, 500)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def test_deep_resoruce(self):"},{"line_number":163,"context_line":"        # keys are built on the fly, and return a dict"},{"line_number":164,"context_line":"        request \u003d webob.Request.blank(\u0027/meta-data/public-keys\u0027)"},{"line_number":165,"context_line":"        request.remote_addr \u003d \u0027127.0.0.1\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F9a4%3D","line":162,"updated":"2011-10-07 00:19:37.000000000","message":"Typo? test_deep_resource","commit_id":"ffb1b404ebc9a0ea64aaa9f602f374d8075a25ca"}]}
