)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"7c9d631b37a8172b75e322dedb50f285aef1e698","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Adds method get_guest to the Host object and updates"},{"line_number":10,"context_line":"the libvirt driver code to use it."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I2923cd939b8dc0dd50799df6d36df31ecc6d8cb1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7a016987_22f11e6b","line":11,"updated":"2015-05-27 11:57:02.000000000","message":"A reference to an outline of the planned libvirt driver refactorings would be good. The reviews could then be made with the overall plan in mind.","commit_id":"1492bf33a9e5f62a1dc9a5115eb603882ea5d68a"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"501d07ad329e9033a5a7c155414b4905ade0d148","unresolved":false,"context_lines":[{"line_number":624,"context_line":"            # TODO(sahid): We are converting all calls from a"},{"line_number":625,"context_line":"            # virDomain object to use nova.virt.libvirt.Guest."},{"line_number":626,"context_line":"            # We should be able to remove virt_dom at the end."},{"line_number":627,"context_line":"            virt_dom \u003d guest._domain"},{"line_number":628,"context_line":"        except exception.InstanceNotFound:"},{"line_number":629,"context_line":"            virt_dom \u003d None"},{"line_number":630,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a0c5dc1_1388ef21","line":627,"updated":"2015-05-12 08:18:40.000000000","message":"This block is copy\u0026paste multiple times. Would it make sense to extract this into an extra method which makes explicitly clear that this is an ongoing refactoring effort? Something like:\n\n    virt_dom \u003d self._wip_get_domain(instance)\n\n    def _wip_get_domain(self, instance):\n        guest \u003d self._host.get_domain(instance)\n        # TODO(sahid): We are converting all calls from a\n        # virDomain object to use nova.virt.libvirt.Guest.\n        # We should be able to remove virt_dom at the end.\n        return guest._domain","commit_id":"d8aaa57885d47c7d6e957d8e2ee3d6dd9467d998"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"6b9164e371bfa22e77be1bad3e9236895d015f34","unresolved":false,"context_lines":[{"line_number":624,"context_line":"            # TODO(sahid): We are converting all calls from a"},{"line_number":625,"context_line":"            # virDomain object to use nova.virt.libvirt.Guest."},{"line_number":626,"context_line":"            # We should be able to remove virt_dom at the end."},{"line_number":627,"context_line":"            virt_dom \u003d guest._domain"},{"line_number":628,"context_line":"        except exception.InstanceNotFound:"},{"line_number":629,"context_line":"            virt_dom \u003d None"},{"line_number":630,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a0c5dc1_79c82575","line":627,"in_reply_to":"9a0c5dc1_1388ef21","updated":"2015-05-12 11:01:52.000000000","message":"Well the point of a TODO note is to give information on a particular part of the code, in our case is to avoid calling directly a virDomain object. I do not believe it makes sense to hide the TODO note behind a method. Before to address your suggestion I will try to get more comments.","commit_id":"d8aaa57885d47c7d6e957d8e2ee3d6dd9467d998"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"501d07ad329e9033a5a7c155414b4905ade0d148","unresolved":false,"context_lines":[{"line_number":1179,"context_line":"    def _get_existing_domain_xml(self, instance, network_info,"},{"line_number":1180,"context_line":"                                 block_device_info\u003dNone):"},{"line_number":1181,"context_line":"        try:"},{"line_number":1182,"context_line":"            xml \u003d str(self._host.get_domain(instance))"},{"line_number":1183,"context_line":"        except exception.InstanceNotFound:"},{"line_number":1184,"context_line":"            image_meta \u003d utils.get_image_from_system_metadata("},{"line_number":1185,"context_line":"                instance.system_metadata)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a0c5dc1_b386c311","line":1182,"updated":"2015-05-12 08:18:40.000000000","message":"In review 174313 I left a comment why I think that using the __str__ of an object for domain logic is a bad idea. The REAL flow here is: \n\n1) get the host object \n\n2) get a GUEST object for the instance (by calling \"get_domain\") \n\n3) get the guests DOMAIN XML (by calling \"__str__\" indirectly with \"str()\").\n\nI see here a mismatch between the naming and what really happens.","commit_id":"d8aaa57885d47c7d6e957d8e2ee3d6dd9467d998"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"6b9164e371bfa22e77be1bad3e9236895d015f34","unresolved":false,"context_lines":[{"line_number":1179,"context_line":"    def _get_existing_domain_xml(self, instance, network_info,"},{"line_number":1180,"context_line":"                                 block_device_info\u003dNone):"},{"line_number":1181,"context_line":"        try:"},{"line_number":1182,"context_line":"            xml \u003d str(self._host.get_domain(instance))"},{"line_number":1183,"context_line":"        except exception.InstanceNotFound:"},{"line_number":1184,"context_line":"            image_meta \u003d utils.get_image_from_system_metadata("},{"line_number":1185,"context_line":"                instance.system_metadata)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a0c5dc1_d9eb91af","line":1182,"in_reply_to":"9a0c5dc1_b386c311","updated":"2015-05-12 11:01:52.000000000","message":"I will remove the change here, actually this part of code should probably be in Guest","commit_id":"d8aaa57885d47c7d6e957d8e2ee3d6dd9467d998"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"1123a512ef8941bcbd35af2b68745a134fa024ee","unresolved":false,"context_lines":[{"line_number":632,"context_line":"                # TODO(sahid): A method shutdown should be dressed in Guest"},{"line_number":633,"context_line":"                # to handle when we needto destroy a domain in libvirt."},{"line_number":634,"context_line":"                virt_dom \u003d guest._domain"},{"line_number":635,"context_line":"                virt_dom.destroy()"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"            except libvirt.libvirtError as e:"},{"line_number":638,"context_line":"                is_okay \u003d False"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a0c5dc1_e3b9d72f","line":635,"updated":"2015-05-13 09:09:53.000000000","message":"It is hard to decide whether it is better to convert this file to use get_guest() now, and then incrementally add the methods to Guest.py. Or whether to add all the neccessary methods to Guest.py and then convert this file to use get_guest().\n\nThey both end up at the same place I guess, so it doesn\u0027t particularly matter. Probably more important to just focus on getting this all merged as quickly as possible, so the intermediate state doesn\u0027t stay for too long.","commit_id":"9c74141c4d05cd36a471408ebc038180b7d9fba4"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0725a880f4a89219c959cb00d15c9d732b4acfa2","unresolved":false,"context_lines":[{"line_number":643,"context_line":"        if guest is not None:"},{"line_number":644,"context_line":"            try:"},{"line_number":645,"context_line":"                old_domid \u003d guest.id"},{"line_number":646,"context_line":"                # TODO(sahid): A method shutdown should be dressed in Guest"},{"line_number":647,"context_line":"                # to handle when we needto destroy a domain in libvirt."},{"line_number":648,"context_line":"                virt_dom \u003d guest._domain"},{"line_number":649,"context_line":"                virt_dom.destroy()"}],"source_content_type":"text/x-python","patch_set":7,"id":"5afe65bd_38b5f1cc","line":646,"updated":"2015-06-02 12:46:12.000000000","message":"Not quite sure what you mean by \"be dressed in Guest\"? Do you mean this instead?\n\n # TODO(sahid): Add Guest.destroy() method to encapsulate\n # domain shutdown and destruction","commit_id":"4d2f5cfabeb5c1e12b6b5066f18f5da8b8f9d013"}],"nova/virt/libvirt/host.py":[{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"501d07ad329e9033a5a7c155414b4905ade0d148","unresolved":false,"context_lines":[{"line_number":591,"context_line":"            lv_ver\u003dlv_ver, hv_ver\u003dhv_ver, hv_type\u003dhv_type, op\u003doperator.ne)"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    def get_domain(self, instance):"},{"line_number":594,"context_line":"        \"\"\"Retrieve libvirt domain object for an instance."},{"line_number":595,"context_line":""},{"line_number":596,"context_line":"        :param instance: an nova.objects.Instance object"},{"line_number":597,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a0c5dc1_339c1369","line":594,"updated":"2015-05-12 08:18:40.000000000","message":"The name of the method should reflect the change as well IMO. And the docstring is in its current form misleading. I would prefer something like this:\n\n    def get_guest(self, instance):\n        \"\"\"Retrieve the nova guest object for an instance.","commit_id":"d8aaa57885d47c7d6e957d8e2ee3d6dd9467d998"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"7c9d631b37a8172b75e322dedb50f285aef1e698","unresolved":false,"context_lines":[{"line_number":590,"context_line":"        return self._version_check("},{"line_number":591,"context_line":"            lv_ver\u003dlv_ver, hv_ver\u003dhv_ver, hv_type\u003dhv_type, op\u003doperator.ne)"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    # TODO(sahid): needs to be private"},{"line_number":594,"context_line":"    def get_domain(self, instance):"},{"line_number":595,"context_line":"        \"\"\"Retrieve libvirt domain object for an instance."},{"line_number":596,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_e211c605","line":593,"updated":"2015-05-27 11:57:02.000000000","message":"Would a \"@deprecated\" decorator (something like this http://code.activestate.com/recipes/391367-deprecated/) make sense? Could be queried easier than TODOs. Just an idea.","commit_id":"1492bf33a9e5f62a1dc9a5115eb603882ea5d68a"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"7c9d631b37a8172b75e322dedb50f285aef1e698","unresolved":false,"context_lines":[{"line_number":608,"context_line":"        return self._get_domain_by_name(instance.name)"},{"line_number":609,"context_line":""},{"line_number":610,"context_line":"    def get_guest(self, instance):"},{"line_number":611,"context_line":"        \"\"\"Retrieve libvirt domain object for an instance."},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"        :param instance: an nova.objects.Instance object"},{"line_number":614,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_22e0fecb","line":611,"updated":"2015-05-27 11:57:02.000000000","message":"nit: \"libvirt domain object\" could be misleading. \"libvirt.Guest object\" is maybe a bit more precise.","commit_id":"1492bf33a9e5f62a1dc9a5115eb603882ea5d68a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0725a880f4a89219c959cb00d15c9d732b4acfa2","unresolved":false,"context_lines":[{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        :returns: a nova.virt.libvirt.Guest object"},{"line_number":617,"context_line":"        \"\"\""},{"line_number":618,"context_line":"        return guest.Guest("},{"line_number":619,"context_line":"            self.get_domain(instance))"},{"line_number":620,"context_line":""},{"line_number":621,"context_line":"    def _get_domain_by_id(self, instance_id):"}],"source_content_type":"text/x-python","patch_set":7,"id":"5afe65bd_b84b21b0","line":618,"updated":"2015-06-02 12:46:12.000000000","message":"Pretty sure this line break wasn\u0027t needed :)","commit_id":"4d2f5cfabeb5c1e12b6b5066f18f5da8b8f9d013"}]}
