)]}'
{"nova/compute/api.py":[{"author":{"_account_id":7537,"name":"Matthew Macdonald-Wallace","email":"mmw@hp.com","username":"macdomat"},"change_message_id":"e40bcef86e79427c8a8c7ed8466e40ba008cd70c","unresolved":false,"context_lines":[{"line_number":579,"context_line":"                base64.decodestring(user_data)"},{"line_number":580,"context_line":"            except base64.binascii.Error:"},{"line_number":581,"context_line":"                raise exception.InstanceUserDataMalformed()"},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"        self._checks_for_create_and_rebuild(context, image_id, image,"},{"line_number":584,"context_line":"                instance_type, metadata, injected_files)"},{"line_number":585,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F4FI%3D","line":582,"updated":"2013-06-19 08:30:42.000000000","message":"If we rename or alter the way that we pass the metadata_dict into this function, then surely we also need to look at checks_for_create_and_build as well?","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":7537,"name":"Matthew Macdonald-Wallace","email":"mmw@hp.com","username":"macdomat"},"change_message_id":"e40bcef86e79427c8a8c7ed8466e40ba008cd70c","unresolved":false,"context_lines":[{"line_number":652,"context_line":"            filter_properties[\u0027force_nodes\u0027] \u003d [forced_node]"},{"line_number":653,"context_line":"        return filter_properties"},{"line_number":654,"context_line":""},{"line_number":655,"context_line":"    def _provision_instances(self, context, instance_type, min_count,"},{"line_number":656,"context_line":"            max_count, base_options, image, security_groups,"},{"line_number":657,"context_line":"            block_device_mapping):"},{"line_number":658,"context_line":"        # Reserve quotas"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F4E8%3D","line":655,"updated":"2013-06-19 08:30:42.000000000","message":"We\u0027ll need to change it here as well?","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"e589d4ce636736540de5c97eb43189240fb7871e","unresolved":false,"context_lines":[{"line_number":698,"context_line":"            return {}"},{"line_number":699,"context_line":""},{"line_number":700,"context_line":"        for bdm in block_device_mapping:"},{"line_number":701,"context_line":"            if bdm.get(\u0027device_name\u0027) \u003d\u003d \"vda\":"},{"line_number":702,"context_line":"                volume_id \u003d bdm.get(\u0027volume_id\u0027)"},{"line_number":703,"context_line":"                if volume_id is not None:"},{"line_number":704,"context_line":"                    try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6N8%3D","line":701,"updated":"2013-06-18 14:47:02.000000000","message":"Again not this patch - but hardcoded \u0027vda\u0027 is just basically guessing. We should be using instance\u0027s \u0027root_device_name\u0027 but this is a bit tricky since it comes from image data. We will solve this issue with blueprint improve-block-device-handling so I guess it can stay for now.","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":7537,"name":"Matthew Macdonald-Wallace","email":"mmw@hp.com","username":"macdomat"},"change_message_id":"aba1984b74fe959857f30d0750a709f79cf61735","unresolved":false,"context_lines":[{"line_number":698,"context_line":"            return {}"},{"line_number":699,"context_line":""},{"line_number":700,"context_line":"        for bdm in block_device_mapping:"},{"line_number":701,"context_line":"            if bdm.get(\u0027device_name\u0027) \u003d\u003d \"vda\":"},{"line_number":702,"context_line":"                volume_id \u003d bdm.get(\u0027volume_id\u0027)"},{"line_number":703,"context_line":"                if volume_id is not None:"},{"line_number":704,"context_line":"                    try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6Lg%3D","line":701,"in_reply_to":"AAAAPn%2F%2F6N8%3D","updated":"2013-06-18 14:57:41.000000000","message":"OK, thanks, I\u0027ll leave it in here.","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"e589d4ce636736540de5c97eb43189240fb7871e","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            image_id, image \u003d self._get_image(context, image_href)"},{"line_number":740,"context_line":"        else:"},{"line_number":741,"context_line":"            image_id \u003d None"},{"line_number":742,"context_line":"            image \u003d {}"},{"line_number":743,"context_line":"            image[\u0027properties\u0027] \u003d \\"},{"line_number":744,"context_line":"                self._get_volume_image_metadata(context,"},{"line_number":745,"context_line":"                    block_device_mapping)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6OM%3D","line":742,"updated":"2013-06-18 14:47:02.000000000","message":"I know it\u0027s not part of this patch but I need to mention it - I really hate that we can have no image set and still have something called an \u0027image\u0027 with \u0027properties\u0027 - this is deeply wrong imho.\n\nWe should at least rename image to be something like metadata_dict everywhere to avoid people using it improperly.\n\nNot that this is propagated ALL THE WAY to the compute node in the request_spec, and can be misused at any point if ti stays like this. Strangely it is not used at all at this point (at least for boot afaict).\n\nThis will cause a lot of pain and is plain misleading.","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"6c978692902e691121c7aeea085be647dfe9faf3","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            image_id, image \u003d self._get_image(context, image_href)"},{"line_number":740,"context_line":"        else:"},{"line_number":741,"context_line":"            image_id \u003d None"},{"line_number":742,"context_line":"            image \u003d {}"},{"line_number":743,"context_line":"            image[\u0027properties\u0027] \u003d \\"},{"line_number":744,"context_line":"                self._get_volume_image_metadata(context,"},{"line_number":745,"context_line":"                    block_device_mapping)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2FrO4%3D","line":742,"in_reply_to":"AAAAPn%2F%2F4Fk%3D","updated":"2013-06-25 14:17:50.000000000","message":"yeah - except I would just rename the arg from image to what Andrew said - boot_media_meta, or boot_media_info or just boot_media","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":7537,"name":"Matthew Macdonald-Wallace","email":"mmw@hp.com","username":"macdomat"},"change_message_id":"e40bcef86e79427c8a8c7ed8466e40ba008cd70c","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            image_id, image \u003d self._get_image(context, image_href)"},{"line_number":740,"context_line":"        else:"},{"line_number":741,"context_line":"            image_id \u003d None"},{"line_number":742,"context_line":"            image \u003d {}"},{"line_number":743,"context_line":"            image[\u0027properties\u0027] \u003d \\"},{"line_number":744,"context_line":"                self._get_volume_image_metadata(context,"},{"line_number":745,"context_line":"                    block_device_mapping)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F4Fk%3D","line":742,"in_reply_to":"AAAAPn%2F%2F4HQ%3D","updated":"2013-06-19 08:30:42.000000000","message":"OK, so just to confirm, _validate_and_build_base_options should be updated to take either an image *or* this metadata_dict (or what ever we\u0027re going to call it!) and then this If statement should be updated so that when image_href is present we create the image but if image_href is not present we pass the metadata_dict from the volume?","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"172c9f731caa3b15528b16a95bfd3942f20bd3ff","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            image_id, image \u003d self._get_image(context, image_href)"},{"line_number":740,"context_line":"        else:"},{"line_number":741,"context_line":"            image_id \u003d None"},{"line_number":742,"context_line":"            image \u003d {}"},{"line_number":743,"context_line":"            image[\u0027properties\u0027] \u003d \\"},{"line_number":744,"context_line":"                self._get_volume_image_metadata(context,"},{"line_number":745,"context_line":"                    block_device_mapping)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F4HQ%3D","line":742,"in_reply_to":"AAAAPn%2F%2F5pk%3D","updated":"2013-06-19 08:10:01.000000000","message":"image_href does not need to change - it\u0027s being handled properly and is set to an emtpy string if there is no image (it actually comes directly from the HTTP request). It is the clash between this and image that I complained about. it might be actually a design flaw to have both image_href and image passed around... but that\u0027s a bit academic at this point :)\n\nFWIW - I don\u0027t think it\u0027d be a *huge* change to do it all the way to the compute node for boot only, and then take it from there for migration etc. - but it will require an RPC version change, and lot of test changes probably. I\u0027m OK with doing it only in the API in this patch tho.","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"01130eb874dc9d9896f79a5c5e31b1249e2cbf40","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            image_id, image \u003d self._get_image(context, image_href)"},{"line_number":740,"context_line":"        else:"},{"line_number":741,"context_line":"            image_id \u003d None"},{"line_number":742,"context_line":"            image \u003d {}"},{"line_number":743,"context_line":"            image[\u0027properties\u0027] \u003d \\"},{"line_number":744,"context_line":"                self._get_volume_image_metadata(context,"},{"line_number":745,"context_line":"                    block_device_mapping)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F5pk%3D","line":742,"in_reply_to":"AAAAPn%2F%2F6FQ%3D","updated":"2013-06-18 17:45:06.000000000","message":"You should be able to safely rename all arguments and methods used here with two exceptions:  the argument name for compute_task_api.build_instances() needs to stay as \u0027image\u0027 unless you want to deal with RPC versioning, and anything in a dict that gets passed to the db or through RPC.  So you can change the argument name in _validate_and_build_base_options, and other methods called from there, but you can\u0027t change things like \u0027image_href\u0027 in base_options because downstream code depends on that name.","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":7537,"name":"Matthew Macdonald-Wallace","email":"mmw@hp.com","username":"macdomat"},"change_message_id":"cea4995b7e0c333d4380d021fcdc3f296c414bc0","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            image_id, image \u003d self._get_image(context, image_href)"},{"line_number":740,"context_line":"        else:"},{"line_number":741,"context_line":"            image_id \u003d None"},{"line_number":742,"context_line":"            image \u003d {}"},{"line_number":743,"context_line":"            image[\u0027properties\u0027] \u003d \\"},{"line_number":744,"context_line":"                self._get_volume_image_metadata(context,"},{"line_number":745,"context_line":"                    block_device_mapping)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6FQ%3D","line":742,"in_reply_to":"AAAAPn%2F%2F6JQ%3D","updated":"2013-06-18 15:21:40.000000000","message":"Except it can\u0027t be renamed here as it needs to be passed to self._validate_and_build_base_options as \"image\" otherwise the metadata won\u0027t be populated correctly.\n\nUnless I name it something like \"boot_media\" and here and then re-assign it to \"image\" before we call the function leaving us the ability to easily rename it in future?","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"646b8dde864d363207c818f751fc3dfceeeca941","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            image_id, image \u003d self._get_image(context, image_href)"},{"line_number":740,"context_line":"        else:"},{"line_number":741,"context_line":"            image_id \u003d None"},{"line_number":742,"context_line":"            image \u003d {}"},{"line_number":743,"context_line":"            image[\u0027properties\u0027] \u003d \\"},{"line_number":744,"context_line":"                self._get_volume_image_metadata(context,"},{"line_number":745,"context_line":"                    block_device_mapping)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6JQ%3D","line":742,"in_reply_to":"AAAAPn%2F%2F6Kw%3D","updated":"2013-06-18 15:08:21.000000000","message":"I agree with the point that Nikola is making, we don\u0027t necessarily have an image so we shouldn\u0027t call it that.  I think metadata_dict is a bit too generic so maybe something like boot_media is better?  Changing the whole chain of methods to accept a new parameter name is more work than I think needs to be done in this patchset, but it can at least be renamed internally here.  And the change can propagate down in future patches.  In my opinion.","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":7537,"name":"Matthew Macdonald-Wallace","email":"mmw@hp.com","username":"macdomat"},"change_message_id":"aba1984b74fe959857f30d0750a709f79cf61735","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            image_id, image \u003d self._get_image(context, image_href)"},{"line_number":740,"context_line":"        else:"},{"line_number":741,"context_line":"            image_id \u003d None"},{"line_number":742,"context_line":"            image \u003d {}"},{"line_number":743,"context_line":"            image[\u0027properties\u0027] \u003d \\"},{"line_number":744,"context_line":"                self._get_volume_image_metadata(context,"},{"line_number":745,"context_line":"                    block_device_mapping)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6Kw%3D","line":742,"in_reply_to":"AAAAPn%2F%2F6OM%3D","updated":"2013-06-18 14:57:41.000000000","message":"Surely that would also mean adjusting all the related functions as well to accept the metadata_dict just to get volume_metadata passed to an instance?\n\nThat seems like a lot of work for such a small change!","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"a8038869f21cdb3073779662ec5af982b24d5659","unresolved":false,"context_lines":[{"line_number":708,"context_line":""},{"line_number":709,"context_line":"        for bdm in block_device_mapping:"},{"line_number":710,"context_line":"            if bdm.get(\u0027device_name\u0027) \u003d\u003d \"vda\":"},{"line_number":711,"context_line":"                volume_id \u003d bdm.get(\u0027volume_id\u0027)"},{"line_number":712,"context_line":"                if volume_id is not None:"},{"line_number":713,"context_line":"                    try:"},{"line_number":714,"context_line":"                        volume \u003d self.volume_api.get(context,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2FrF4%3D","line":711,"updated":"2013-06-25 14:53:09.000000000","message":"Hey - I was just looking at this code for a patch I\u0027m working on ans I noticed another thing we should fix - we should take into account snapshots too, as they can be bootable as well (and cinder does copy the metadata over as expected).\n\nOne more reason to have a \u0027boot_media(_meta)\u0027 instead of \u0027image\u0027","commit_id":"46093c681005c3d6532661dd0463c3d68c8252b3"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"82ed8514117955ef661cf21ad3f9ee25c66fb776","unresolved":false,"context_lines":[{"line_number":695,"context_line":"        QUOTAS.commit(context, quota_reservations)"},{"line_number":696,"context_line":"        return instances"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"    def _get_volume_image_metadata(self, context, block_device_mapping):"},{"line_number":699,"context_line":"        \"\"\"If we are booting from a volume, we need to get the"},{"line_number":700,"context_line":"        volume details from Cinder and make sure we pass the"},{"line_number":701,"context_line":"        metadata back accordingly."}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2Fhp0%3D","line":698,"updated":"2013-06-28 14:43:46.000000000","message":"Well I\u0027d rename this since the metadata may not come from an image (it can come from a volume for snapshots), which reminds me that snapshot issue I mentioned before was not touched - but since I plan to rework this code anyway, and it fixes a bug (kind of) - I\u0027m OK with it.","commit_id":"5f28983c8796f3a1ffa5805aa8c9a594b5993691"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8dbf64588a2af12d785b240d4b6b5d698add878b","unresolved":false,"context_lines":[{"line_number":747,"context_line":"            image_id, boot_meta \u003d self._get_image(context, image_href)"},{"line_number":748,"context_line":"        else:"},{"line_number":749,"context_line":"            image_id \u003d None"},{"line_number":750,"context_line":"            boot_meta \u003d {}"},{"line_number":751,"context_line":"            boot_meta[\u0027properties\u0027] \u003d \\"},{"line_number":752,"context_line":"                self._get_volume_image_metadata(context,"},{"line_number":753,"context_line":"                    block_device_mapping)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2F5ww%3D","line":750,"updated":"2013-07-09 14:26:58.000000000","message":"you do not need this line. you can consider doing the following:\nboot_meta \u003d {\u0027\u0027properties\u0027: self._get_volume_image_metadata(context, ...) }","commit_id":"d12133bbb3bd77a3a3c8bfe7bd19dbb63d3af7ed"}],"nova/tests/api/openstack/compute/test_servers.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"dbac445ca3e7ca875762a3736c0e98324539b23b","unresolved":false,"context_lines":[{"line_number":2479,"context_line":"        compute_api.API._validate_bdm(mox.IgnoreArg(),"},{"line_number":2480,"context_line":"                mox.IgnoreArg()).AndReturn(True)"},{"line_number":2481,"context_line":"        compute_api.API._get_volume_image_metadata(mox.IgnoreArg(),"},{"line_number":2482,"context_line":"                bdm).AndReturn(volume)"},{"line_number":2483,"context_line":"        params \u003d {\u0027block_device_mapping\u0027: bdm}"},{"line_number":2484,"context_line":"        old_create \u003d compute_api.API.create"},{"line_number":2485,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6NI%3D","line":2482,"updated":"2013-06-18 14:42:29.000000000","message":"This should be returning volume[\u0027volume_image_metadata\u0027] right?  It\u0027s not being used anywhere and therefore not causing an issue.  But maybe it would be good to check that the correct data is returned somewhere.","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"646b8dde864d363207c818f751fc3dfceeeca941","unresolved":false,"context_lines":[{"line_number":2479,"context_line":"        compute_api.API._validate_bdm(mox.IgnoreArg(),"},{"line_number":2480,"context_line":"                mox.IgnoreArg()).AndReturn(True)"},{"line_number":2481,"context_line":"        compute_api.API._get_volume_image_metadata(mox.IgnoreArg(),"},{"line_number":2482,"context_line":"                bdm).AndReturn(volume)"},{"line_number":2483,"context_line":"        params \u003d {\u0027block_device_mapping\u0027: bdm}"},{"line_number":2484,"context_line":"        old_create \u003d compute_api.API.create"},{"line_number":2485,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6KU%3D","line":2482,"in_reply_to":"AAAAPn%2F%2F6Lw%3D","updated":"2013-06-18 15:08:21.000000000","message":"Well, this is testing that _get_volume_image_metadata is being called, which is good.  What\u0027s not being tested here is that image[\u0027properties\u0027] has the right value.  Maybe set a stub on compute_api.API.compute_task_api.build_instances() and ensure that the image param has a valid dict with \u0027properties\u0027 set correctly.  Or check at _validate_and_build_base_options.","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":7537,"name":"Matthew Macdonald-Wallace","email":"mmw@hp.com","username":"macdomat"},"change_message_id":"dd0340ad1cf64b4027991849d4f4d73506cac462","unresolved":false,"context_lines":[{"line_number":2479,"context_line":"        compute_api.API._validate_bdm(mox.IgnoreArg(),"},{"line_number":2480,"context_line":"                mox.IgnoreArg()).AndReturn(True)"},{"line_number":2481,"context_line":"        compute_api.API._get_volume_image_metadata(mox.IgnoreArg(),"},{"line_number":2482,"context_line":"                bdm).AndReturn(volume)"},{"line_number":2483,"context_line":"        params \u003d {\u0027block_device_mapping\u0027: bdm}"},{"line_number":2484,"context_line":"        old_create \u003d compute_api.API.create"},{"line_number":2485,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6Lw%3D","line":2482,"in_reply_to":"AAAAPn%2F%2F6NI%3D","updated":"2013-06-18 14:49:02.000000000","message":"So it could be removed entirely?","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"}],"nova/tests/compute/test_compute.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"dbac445ca3e7ca875762a3736c0e98324539b23b","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        self.stubs.Set(self.compute_api.volume_api, \u0027get\u0027,"},{"line_number":416,"context_line":"                lambda *a, **kw: expected_output)"},{"line_number":417,"context_line":"        vol \u003d self.compute_api.volume_api.get(self.context,"},{"line_number":418,"context_line":"                block_device_mapping)"},{"line_number":419,"context_line":"        vol_md \u003d self.compute_api._get_volume_image_metadata(self.context,"},{"line_number":420,"context_line":"                block_device_mapping)"},{"line_number":421,"context_line":"        self.assertEqual(vol_md[\u0027test_key\u0027], \u0027test_value\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6Nw%3D","line":418,"updated":"2013-06-18 14:42:29.000000000","message":"What are these lines 414-418 doing?  They don\u0027t seem to be necessary for the test.","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":7537,"name":"Matthew Macdonald-Wallace","email":"mmw@hp.com","username":"macdomat"},"change_message_id":"cea4995b7e0c333d4380d021fcdc3f296c414bc0","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        self.stubs.Set(self.compute_api.volume_api, \u0027get\u0027,"},{"line_number":416,"context_line":"                lambda *a, **kw: expected_output)"},{"line_number":417,"context_line":"        vol \u003d self.compute_api.volume_api.get(self.context,"},{"line_number":418,"context_line":"                block_device_mapping)"},{"line_number":419,"context_line":"        vol_md \u003d self.compute_api._get_volume_image_metadata(self.context,"},{"line_number":420,"context_line":"                block_device_mapping)"},{"line_number":421,"context_line":"        self.assertEqual(vol_md[\u0027test_key\u0027], \u0027test_value\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6E0%3D","line":418,"in_reply_to":"AAAAPn%2F%2F6I0%3D","updated":"2013-06-18 15:21:40.000000000","message":"fair enough... :)","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"646b8dde864d363207c818f751fc3dfceeeca941","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        self.stubs.Set(self.compute_api.volume_api, \u0027get\u0027,"},{"line_number":416,"context_line":"                lambda *a, **kw: expected_output)"},{"line_number":417,"context_line":"        vol \u003d self.compute_api.volume_api.get(self.context,"},{"line_number":418,"context_line":"                block_device_mapping)"},{"line_number":419,"context_line":"        vol_md \u003d self.compute_api._get_volume_image_metadata(self.context,"},{"line_number":420,"context_line":"                block_device_mapping)"},{"line_number":421,"context_line":"        self.assertEqual(vol_md[\u0027test_key\u0027], \u0027test_value\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6I0%3D","line":418,"in_reply_to":"AAAAPn%2F%2F6L4%3D","updated":"2013-06-18 15:08:21.000000000","message":"Sorry, you\u0027re right that the stub needs to stay.  But the call on line 417 doesn\u0027t seem necessary.\n\nI think it\u0027s worthwhile to test that _get_volume_image_metadata is returning the proper thing here because it doesn\u0027t appear to be tested anywhere else.","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"},{"author":{"_account_id":7537,"name":"Matthew Macdonald-Wallace","email":"mmw@hp.com","username":"macdomat"},"change_message_id":"dd0340ad1cf64b4027991849d4f4d73506cac462","unresolved":false,"context_lines":[{"line_number":415,"context_line":"        self.stubs.Set(self.compute_api.volume_api, \u0027get\u0027,"},{"line_number":416,"context_line":"                lambda *a, **kw: expected_output)"},{"line_number":417,"context_line":"        vol \u003d self.compute_api.volume_api.get(self.context,"},{"line_number":418,"context_line":"                block_device_mapping)"},{"line_number":419,"context_line":"        vol_md \u003d self.compute_api._get_volume_image_metadata(self.context,"},{"line_number":420,"context_line":"                block_device_mapping)"},{"line_number":421,"context_line":"        self.assertEqual(vol_md[\u0027test_key\u0027], \u0027test_value\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPn%2F%2F6L4%3D","line":418,"in_reply_to":"AAAAPn%2F%2F6Nw%3D","updated":"2013-06-18 14:49:02.000000000","message":"Without the stub, the volume_api.get function fails as it tries to connect to Cinder which is not running and does not have a volume with an ID of \"fake\".\n\nBy stubbing out this function, we test that _get_volume_image_metadata() returns the correct values.\n\nMy personal feeling is that this function does not require a unit test as it is really just a wrapper around other code that is already tested, however I was concerned that if there were no unit tests then the change would be rejected outright.","commit_id":"e8112374460fe14e05dd3791bc5bb89524014064"}]}
