)]}'
{"nova/virt/vmwareapi/vmops.py":[{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"870adff6fef0865cb14a4fa016ba57cbd45a8f5f","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        self.vm_ref \u003d vm_ref"},{"line_number":101,"context_line":"        pass"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"def get_image_handler(vi):"},{"line_number":104,"context_line":"    handler \u003d FileBasedDownloadImageHandler(vi)"},{"line_number":105,"context_line":"    return handler"},{"line_number":106,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2BfjI%3D","line":103,"updated":"2014-03-26 12:49:55.000000000","message":"this should be an instance method in VirtualMachineInstanceConfigInfo","commit_id":"05ac49a6f5a9837f1647de1faa225acec37af82f"},{"author":{"_account_id":8027,"name":"Vui Lam","email":"vui@vmware.com","username":"vui"},"change_message_id":"2b10ee3985ed5af0b4cd254b7579b944f9057a01","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        self.vm_ref \u003d vm_ref"},{"line_number":101,"context_line":"        pass"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"def get_image_handler(vi):"},{"line_number":104,"context_line":"    handler \u003d FileBasedDownloadImageHandler(vi)"},{"line_number":105,"context_line":"    return handler"},{"line_number":106,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2BYCU%3D","line":103,"in_reply_to":"AAAAWH%2F%2BfjI%3D","updated":"2014-03-27 09:14:36.000000000","message":"Let me think about this a little more. I am resisting the urge to treat VirtualMachineInstanceConfigInfo as more than a collection of configuration properties now. Maybe this speaks to the need for another class with a more appropriate name/role to house these methods.","commit_id":"05ac49a6f5a9837f1647de1faa225acec37af82f"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"870adff6fef0865cb14a4fa016ba57cbd45a8f5f","unresolved":false,"context_lines":[{"line_number":104,"context_line":"    handler \u003d FileBasedDownloadImageHandler(vi)"},{"line_number":105,"context_line":"    return handler"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"def get_image_adapter(vi):"},{"line_number":108,"context_line":"    if vi.disk_type \u003d\u003d \"thin\" or vi.disk_type \u003d\u003d \"preallocated\":"},{"line_number":109,"context_line":"        return FlatAdapter(vi)"},{"line_number":110,"context_line":"    elif vi.disk_type \u003d\u003d \"sparse\":"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2BfjA%3D","line":107,"updated":"2014-03-26 12:49:55.000000000","message":"this should be an instance method in VirtualMachineInstanceConfigInfo","commit_id":"05ac49a6f5a9837f1647de1faa225acec37af82f"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"870adff6fef0865cb14a4fa016ba57cbd45a8f5f","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        return IsoAdapter(vi)"},{"line_number":114,"context_line":"    raise NotImplementedError(\"\")"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"def get_image_use(vi):"},{"line_number":117,"context_line":"    if vi.linked_clone:"},{"line_number":118,"context_line":"        return LinkedC"},{"line_number":119,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2Bfi4%3D","line":116,"updated":"2014-03-26 12:49:55.000000000","message":"this should be an instance method in VirtualMachineInstanceConfigInfo","commit_id":"05ac49a6f5a9837f1647de1faa225acec37af82f"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"870adff6fef0865cb14a4fa016ba57cbd45a8f5f","unresolved":false,"context_lines":[{"line_number":453,"context_line":"         vi.adapter_type,"},{"line_number":454,"context_line":"         vi.disk_type,"},{"line_number":455,"context_line":"         vi.vif_model,"},{"line_number":456,"context_line":"         vi.image_linked_clone) \u003d self.get_image_properties(context, instance,"},{"line_number":457,"context_line":"                                                            vi.root_gb_in_kb)"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"        # this logic allows for instances or images to decide"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2BfhE%3D","line":456,"updated":"2014-03-26 12:49:55.000000000","message":"maybe we should return an object here, e.g. VirtualDisk","commit_id":"05ac49a6f5a9837f1647de1faa225acec37af82f"},{"author":{"_account_id":8027,"name":"Vui Lam","email":"vui@vmware.com","username":"vui"},"change_message_id":"2b10ee3985ed5af0b4cd254b7579b944f9057a01","unresolved":false,"context_lines":[{"line_number":453,"context_line":"         vi.adapter_type,"},{"line_number":454,"context_line":"         vi.disk_type,"},{"line_number":455,"context_line":"         vi.vif_model,"},{"line_number":456,"context_line":"         vi.image_linked_clone) \u003d self.get_image_properties(context, instance,"},{"line_number":457,"context_line":"                                                            vi.root_gb_in_kb)"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"        # this logic allows for instances or images to decide"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2BYI4%3D","line":456,"in_reply_to":"AAAAWH%2F%2BfhE%3D","updated":"2014-03-27 09:14:36.000000000","message":"Shawn has a patch out that does just that https://review.openstack.org/#/c/81354/ which I intend to incorporate.","commit_id":"05ac49a6f5a9837f1647de1faa225acec37af82f"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"870adff6fef0865cb14a4fa016ba57cbd45a8f5f","unresolved":false,"context_lines":[{"line_number":580,"context_line":"        # will ensure that the aging will not delete a cache image if it"},{"line_number":581,"context_line":"        # is going to be used now."},{"line_number":582,"context_line":"        if CONF.remove_unused_base_images:"},{"line_number":583,"context_line":"            ds_path \u003d ds_util.build_datastore_path(vi.data_store_name,"},{"line_number":584,"context_line":"                                                   vi._base_folder)"},{"line_number":585,"context_line":"            path \u003d self._imagecache.timestamp_folder_get(ds_path,"},{"line_number":586,"context_line":"                                                         vi.image_name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2Bff0%3D","line":583,"updated":"2014-03-26 12:49:55.000000000","message":"I guess we\u0027ll remove build_datastore_path and use DsPath","commit_id":"05ac49a6f5a9837f1647de1faa225acec37af82f"},{"author":{"_account_id":8027,"name":"Vui Lam","email":"vui@vmware.com","username":"vui"},"change_message_id":"2b10ee3985ed5af0b4cd254b7579b944f9057a01","unresolved":false,"context_lines":[{"line_number":580,"context_line":"        # will ensure that the aging will not delete a cache image if it"},{"line_number":581,"context_line":"        # is going to be used now."},{"line_number":582,"context_line":"        if CONF.remove_unused_base_images:"},{"line_number":583,"context_line":"            ds_path \u003d ds_util.build_datastore_path(vi.data_store_name,"},{"line_number":584,"context_line":"                                                   vi._base_folder)"},{"line_number":585,"context_line":"            path \u003d self._imagecache.timestamp_folder_get(ds_path,"},{"line_number":586,"context_line":"                                                         vi.image_name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2BX%2FU%3D","line":583,"in_reply_to":"AAAAWH%2F%2Bff0%3D","updated":"2014-03-27 09:14:36.000000000","message":"Done. In the interest of reducing noise, there are other occurances outside of the modified lines that I elected not to convert in this patch","commit_id":"05ac49a6f5a9837f1647de1faa225acec37af82f"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"6044416a080a8d66e285898e880d65f68142dc13","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    return uuidutils.generate_uuid()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"class VirtualMachineInstanceConfigInfo(object):"},{"line_number":93,"context_line":"    def __init__(self):"},{"line_number":94,"context_line":"        # define fields?"},{"line_number":95,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BVPk%3D","line":92,"updated":"2014-03-27 15:28:35.000000000","message":"I think this might be the most important innovation in the patch. I actually think we might want to push this metaphor a little further.","commit_id":"4d1379a52f50488226426897b4a6d1e79027115e"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"6044416a080a8d66e285898e880d65f68142dc13","unresolved":false,"context_lines":[{"line_number":477,"context_line":"         vi.disk_type,"},{"line_number":478,"context_line":"         vi.vif_model,"},{"line_number":479,"context_line":"         vi.image_linked_clone) \u003d self.get_image_properties(context, instance,"},{"line_number":480,"context_line":"                                                            vi.root_gb_in_kb)"},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"        # this logic allows for instances or images to decide"},{"line_number":483,"context_line":"        # for themselves which strategy is best for them."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BVPI%3D","line":480,"updated":"2014-03-27 15:28:35.000000000","message":"A lot around lines 458 to 493 turns out to be very redundant. I have a refactor that simplifies this logic that I\u0027ll post later.","commit_id":"4d1379a52f50488226426897b4a6d1e79027115e"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"6044416a080a8d66e285898e880d65f68142dc13","unresolved":false,"context_lines":[{"line_number":518,"context_line":"                                                  vi.instance_name)"},{"line_number":519,"context_line":"        else:"},{"line_number":520,"context_line":"            vm_ref \u003d vm_util.get_vm_ref(self._session, vi.instance)"},{"line_number":521,"context_line":"        return vm_ref"},{"line_number":522,"context_line":""},{"line_number":523,"context_line":"    @work_step"},{"line_number":524,"context_line":"    def _create_vm(self, vi):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BVN4%3D","line":521,"updated":"2014-03-27 15:28:35.000000000","message":"512 to 521 kind of exacerbates the issues we had around vm_util.py ... that\u0027s why I\u0027ve asked that to be our next refactor. If you actually need to make another mechanism to get_vm_ref you may miss the cache... and if you need to miss the cache, that\u0027s kind of interesting in itself.","commit_id":"4d1379a52f50488226426897b4a6d1e79027115e"},{"author":{"_account_id":8027,"name":"Vui Lam","email":"vui@vmware.com","username":"vui"},"change_message_id":"97d332f2ca4128625633cece62bd337f876dcd6d","unresolved":false,"context_lines":[{"line_number":518,"context_line":"                                                  vi.instance_name)"},{"line_number":519,"context_line":"        else:"},{"line_number":520,"context_line":"            vm_ref \u003d vm_util.get_vm_ref(self._session, vi.instance)"},{"line_number":521,"context_line":"        return vm_ref"},{"line_number":522,"context_line":""},{"line_number":523,"context_line":"    @work_step"},{"line_number":524,"context_line":"    def _create_vm(self, vi):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BT8g%3D","line":521,"in_reply_to":"AAAAWH%2F%2BVN4%3D","updated":"2014-03-27 17:31:06.000000000","message":"If we are not stashing the vm_ref after creation, I am not opposed to looking it up in the cache, but yeah, we should just have one way to do a cache lookup no matter the context. There are already other call sites doing the lookup and the ones that are not part of spawn() has no choice but to look up the vm ref somehow. Looking it up earlier in spawn just means populating the cache with the entry a little sooner. \n\nThat said, please see next comment below; I think I will revert back to an older patch where I use the saved vm_ref, eliminating the lookup.","commit_id":"4d1379a52f50488226426897b4a6d1e79027115e"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"6044416a080a8d66e285898e880d65f68142dc13","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                                      vi.dc_info.vmFolder, vi.res_pool_ref)"},{"line_number":533,"context_line":""},{"line_number":534,"context_line":"        # Note(vui): just populate the vm lookup cache with task.result?"},{"line_number":535,"context_line":"        return VirtualMachine(vi, self._get_vm_ref(vi))"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"    @work_step"},{"line_number":538,"context_line":"    def _attach_from_block_device_mapping(self, vi):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BVNc%3D","line":535,"updated":"2014-03-27 15:28:35.000000000","message":"One of the other refactors does pull the task result for the vm_ref this eliminates a round trip to the server.","commit_id":"4d1379a52f50488226426897b4a6d1e79027115e"},{"author":{"_account_id":8027,"name":"Vui Lam","email":"vui@vmware.com","username":"vui"},"change_message_id":"97d332f2ca4128625633cece62bd337f876dcd6d","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                                      vi.dc_info.vmFolder, vi.res_pool_ref)"},{"line_number":533,"context_line":""},{"line_number":534,"context_line":"        # Note(vui): just populate the vm lookup cache with task.result?"},{"line_number":535,"context_line":"        return VirtualMachine(vi, self._get_vm_ref(vi))"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"    @work_step"},{"line_number":538,"context_line":"    def _attach_from_block_device_mapping(self, vi):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BUFE%3D","line":535,"in_reply_to":"AAAAWH%2F%2BVNc%3D","updated":"2014-03-27 17:31:06.000000000","message":"Glad you pointed in out. In my older branch execute_create_vm, returns the task.result as the vm_ref, and we stash that in the VirtualMachine object new_vm. I undid that thinking to keep the factored code more in line with what folks are doing, but yeah we can leverage the task result for sure.","commit_id":"4d1379a52f50488226426897b4a6d1e79027115e"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"6044416a080a8d66e285898e880d65f68142dc13","unresolved":false,"context_lines":[{"line_number":623,"context_line":"        # Builds the VirtualMachineInstanceConfigInfo object"},{"line_number":624,"context_line":"        # to house the parameters need to create new instance"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":"        vi \u003d self._get_vm_config_info("},{"line_number":627,"context_line":"            context, instance, image_meta, injected_files,"},{"line_number":628,"context_line":"            admin_password, network_info, block_device_info,"},{"line_number":629,"context_line":"            instance_name, power_on)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BVMA%3D","line":626,"updated":"2014-03-27 15:28:35.000000000","message":"If I understand where you are going here, I think we can eliminate the get_image_properties business almost completely. Let me think on this.","commit_id":"4d1379a52f50488226426897b4a6d1e79027115e"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"ed29e6016e6216b5c7b6e7c4e8adfb55e1c38d45","unresolved":false,"context_lines":[{"line_number":1872,"context_line":"# Image Handlers"},{"line_number":1873,"context_line":""},{"line_number":1874,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":1875,"context_line":"class ImageHandler(object):"},{"line_number":1876,"context_line":"    \"\"\"Image Handler abstract base class."},{"line_number":1877,"context_line":""},{"line_number":1878,"context_line":"    Image handlers are responsible for obtaining the data of the image."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F93Mo%3D","line":1875,"updated":"2014-04-01 15:25:13.000000000","message":"are we going to have other handlers beside DownloadImageHandler? I prefer to start with a flatter hierarchy and add more levels if needed","commit_id":"de334795f87086b0074c0e4076b46b5033cb43f7"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"ed29e6016e6216b5c7b6e7c4e8adfb55e1c38d45","unresolved":false,"context_lines":[{"line_number":2226,"context_line":""},{"line_number":2227,"context_line":""},{"line_number":2228,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":2229,"context_line":"class ImageUser(object):"},{"line_number":2230,"context_line":"    \"\"\"Image user abstract base class"},{"line_number":2231,"context_line":""},{"line_number":2232,"context_line":"    Image users defines how a cache image is used by a newly spawned virtual"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F93Qg%3D","line":2229,"updated":"2014-04-01 15:25:13.000000000","message":"do we really need a full-blown hierarchy of classes for this? I think a simple callback function will do the job here","commit_id":"de334795f87086b0074c0e4076b46b5033cb43f7"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"bb2428f46cf143f51bc1f955e365f89dbe286923","unresolved":false,"context_lines":[{"line_number":2226,"context_line":""},{"line_number":2227,"context_line":""},{"line_number":2228,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":2229,"context_line":"class ImageUser(object):"},{"line_number":2230,"context_line":"    \"\"\"Image user abstract base class"},{"line_number":2231,"context_line":""},{"line_number":2232,"context_line":"    Image users defines how a cache image is used by a newly spawned virtual"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAWH%2F917s%3D","line":2229,"in_reply_to":"AAAAWH%2F93Qg%3D","updated":"2014-04-01 18:17:23.000000000","message":"I\u0027m thinking we can use \"functions as first class citizens\" rule on these. In Python, we can pass around method pointers so I\u0027m thinking we can just have a collection of named methods then in get_image_user we can return a pointer to the method we want.\n\nYou can also do currying if you need to change method signatures between different handlers/users.","commit_id":"de334795f87086b0074c0e4076b46b5033cb43f7"}]}
