)]}'
{"blazar/manager/service.py":[{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"7749cfff07e2239462b91af601369ee565d438d9","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        if resource_type not in self.plugins:"},{"line_number":446,"context_line":"            raise exceptions.UnsupportedResourceType("},{"line_number":447,"context_line":"                resource_type)"},{"line_number":448,"context_line":"        else:"},{"line_number":449,"context_line":"            reservation_values \u003d {"},{"line_number":450,"context_line":"                \u0027lease_id\u0027: values[\u0027lease_id\u0027],"},{"line_number":451,"context_line":"                \u0027resource_type\u0027: resource_type,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_666e4c96","line":448,"range":{"start_line":448,"start_character":0,"end_line":448,"end_character":13},"updated":"2017-05-22 07:26:35.000000000","message":"Is it needed the else-statement?","commit_id":"a3b4850b6550ba0605d049f634d977f8a25605a1"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"ab393cec3be5c98f6cbcb543151fb90c125ea9cc","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        if resource_type not in self.plugins:"},{"line_number":446,"context_line":"            raise exceptions.UnsupportedResourceType("},{"line_number":447,"context_line":"                resource_type)"},{"line_number":448,"context_line":"        else:"},{"line_number":449,"context_line":"            reservation_values \u003d {"},{"line_number":450,"context_line":"                \u0027lease_id\u0027: values[\u0027lease_id\u0027],"},{"line_number":451,"context_line":"                \u0027resource_type\u0027: resource_type,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_c983e8cb","line":448,"range":{"start_line":448,"start_character":0,"end_line":448,"end_character":13},"in_reply_to":"ff0f0b1f_666e4c96","updated":"2017-05-23 01:01:06.000000000","message":"Agree. I\u0027ve removed this else-statement.","commit_id":"a3b4850b6550ba0605d049f634d977f8a25605a1"}],"blazar/plugins/base.py":[{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"7749cfff07e2239462b91af601369ee565d438d9","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        }"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    @abc.abstractmethod"},{"line_number":63,"context_line":"    def create_reservation(self, reservation_id, values):"},{"line_number":64,"context_line":"        \"\"\"Create reservation.\"\"\""},{"line_number":65,"context_line":"        pass"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_e6993c6e","line":63,"range":{"start_line":63,"start_character":8,"end_line":63,"end_character":26},"updated":"2017-05-22 07:26:35.000000000","message":"It\u0027s good to change the method\u0027s name since it causes misunderstandings.  This method doesn\u0027t create a \u0027reservation\u0027 but create resources for the reservation.\n\ncreate_resource or prepare_resource?","commit_id":"a3b4850b6550ba0605d049f634d977f8a25605a1"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"ab393cec3be5c98f6cbcb543151fb90c125ea9cc","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        }"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    @abc.abstractmethod"},{"line_number":63,"context_line":"    def create_reservation(self, reservation_id, values):"},{"line_number":64,"context_line":"        \"\"\"Create reservation.\"\"\""},{"line_number":65,"context_line":"        pass"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_29726412","line":63,"range":{"start_line":63,"start_character":8,"end_line":63,"end_character":26},"in_reply_to":"ff0f0b1f_e6993c6e","updated":"2017-05-23 01:01:06.000000000","message":"How about \u0027reserve_resource\u0027?","commit_id":"a3b4850b6550ba0605d049f634d977f8a25605a1"}],"blazar/plugins/oshosts/host_plugin.py":[{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"7749cfff07e2239462b91af601369ee565d438d9","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        \"\"\"Remove the hosts from the pool.\"\"\""},{"line_number":184,"context_line":"        reservations \u003d db_api.reservation_get_all_by_values("},{"line_number":185,"context_line":"            resource_id\u003dresource_id)"},{"line_number":186,"context_line":"        for reservation in reservations:"},{"line_number":187,"context_line":"            db_api.reservation_update(reservation[\u0027id\u0027],"},{"line_number":188,"context_line":"                                      {\u0027status\u0027: \u0027completed\u0027})"},{"line_number":189,"context_line":"            host_reservation \u003d db_api.host_reservation_get_by_reservation_id("},{"line_number":190,"context_line":"                reservation[\u0027id\u0027])"},{"line_number":191,"context_line":"            db_api.host_reservation_update(host_reservation[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_468ea8d0","side":"PARENT","line":188,"range":{"start_line":186,"start_character":0,"end_line":188,"end_character":62},"updated":"2017-05-22 07:26:35.000000000","message":"manager class need to handle this change at end_lease method.","commit_id":"a7910866f453e03ebcbde2f82ca866ea3340987b"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"ab393cec3be5c98f6cbcb543151fb90c125ea9cc","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        \"\"\"Remove the hosts from the pool.\"\"\""},{"line_number":184,"context_line":"        reservations \u003d db_api.reservation_get_all_by_values("},{"line_number":185,"context_line":"            resource_id\u003dresource_id)"},{"line_number":186,"context_line":"        for reservation in reservations:"},{"line_number":187,"context_line":"            db_api.reservation_update(reservation[\u0027id\u0027],"},{"line_number":188,"context_line":"                                      {\u0027status\u0027: \u0027completed\u0027})"},{"line_number":189,"context_line":"            host_reservation \u003d db_api.host_reservation_get_by_reservation_id("},{"line_number":190,"context_line":"                reservation[\u0027id\u0027])"},{"line_number":191,"context_line":"            db_api.host_reservation_update(host_reservation[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_aa43ff6b","side":"PARENT","line":188,"range":{"start_line":186,"start_character":0,"end_line":188,"end_character":62},"in_reply_to":"ff0f0b1f_468ea8d0","updated":"2017-05-23 01:01:06.000000000","message":"I\u0027m not sure this \u0027completed\u0027 status is needed because the manager updates the status to \u0027deleted\u0027 right after calling the on_end().","commit_id":"a7910866f453e03ebcbde2f82ca866ea3340987b"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"a3a3a62498e961621be0451847bff22550b68edd","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        \"\"\"Remove the hosts from the pool.\"\"\""},{"line_number":184,"context_line":"        reservations \u003d db_api.reservation_get_all_by_values("},{"line_number":185,"context_line":"            resource_id\u003dresource_id)"},{"line_number":186,"context_line":"        for reservation in reservations:"},{"line_number":187,"context_line":"            db_api.reservation_update(reservation[\u0027id\u0027],"},{"line_number":188,"context_line":"                                      {\u0027status\u0027: \u0027completed\u0027})"},{"line_number":189,"context_line":"            host_reservation \u003d db_api.host_reservation_get_by_reservation_id("},{"line_number":190,"context_line":"                reservation[\u0027id\u0027])"},{"line_number":191,"context_line":"            db_api.host_reservation_update(host_reservation[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_8607f682","side":"PARENT","line":188,"range":{"start_line":186,"start_character":0,"end_line":188,"end_character":62},"in_reply_to":"ff0f0b1f_aa43ff6b","updated":"2017-05-23 06:40:28.000000000","message":"Now that I think the current status transition should kept until we make a clear definition of a state machine for Blazar. So, I\u0027ve added this status transition into the end_lease() of the manager.","commit_id":"a7910866f453e03ebcbde2f82ca866ea3340987b"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"7749cfff07e2239462b91af601369ee565d438d9","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                        pool \u003d rp.ReservationPool()"},{"line_number":129,"context_line":"                        hosts_in_pool.extend(pool.get_computehosts("},{"line_number":130,"context_line":"                            host_reservation[\u0027aggregate_id\u0027]))"},{"line_number":131,"context_line":"                    if (hosts_in_pool and"},{"line_number":132,"context_line":"                            self.nova.hypervisors.get("},{"line_number":133,"context_line":"                                self._get_hypervisor_from_name_or_id("},{"line_number":134,"context_line":"                                    allocation[\u0027compute_host_id\u0027])"},{"line_number":135,"context_line":"                            ).__dict__[\u0027running_vms\u0027] \u003e 0):"},{"line_number":136,"context_line":"                        raise manager_ex.NotEnoughHostsAvailable()"},{"line_number":137,"context_line":"            if allocations:"},{"line_number":138,"context_line":"                host_ids \u003d self._matching_hosts("},{"line_number":139,"context_line":"                    host_reservation[\u0027hypervisor_properties\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_295024d4","line":136,"range":{"start_line":131,"start_character":0,"end_line":136,"end_character":66},"updated":"2017-05-22 07:26:35.000000000","message":"Do you know the reason of the codes?  I\u0027m not sure why the check locates here because if another lease which is not related to the updated lease uses allocation[\u0027compute_host_id\u0027] it fails to update the lease.\n\nIf the codes is not needed L125-130 is not need.","commit_id":"a3b4850b6550ba0605d049f634d977f8a25605a1"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"ab393cec3be5c98f6cbcb543151fb90c125ea9cc","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                        pool \u003d rp.ReservationPool()"},{"line_number":129,"context_line":"                        hosts_in_pool.extend(pool.get_computehosts("},{"line_number":130,"context_line":"                            host_reservation[\u0027aggregate_id\u0027]))"},{"line_number":131,"context_line":"                    if (hosts_in_pool and"},{"line_number":132,"context_line":"                            self.nova.hypervisors.get("},{"line_number":133,"context_line":"                                self._get_hypervisor_from_name_or_id("},{"line_number":134,"context_line":"                                    allocation[\u0027compute_host_id\u0027])"},{"line_number":135,"context_line":"                            ).__dict__[\u0027running_vms\u0027] \u003e 0):"},{"line_number":136,"context_line":"                        raise manager_ex.NotEnoughHostsAvailable()"},{"line_number":137,"context_line":"            if allocations:"},{"line_number":138,"context_line":"                host_ids \u003d self._matching_hosts("},{"line_number":139,"context_line":"                    host_reservation[\u0027hypervisor_properties\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_2ac7ef66","line":136,"range":{"start_line":131,"start_character":0,"end_line":136,"end_character":66},"in_reply_to":"ff0f0b1f_295024d4","updated":"2017-05-23 01:01:06.000000000","message":"For extending the period, the update_reservation() checks if it is possible to extend the period of the reserved host or not. If NOT possible, the update_reservation() tries to find another host which is available at the extended period. If the another host is found, the original reserved host is canceled and the another host is reserved instead. However, if instances have been already launched and running on the original reserved host at that time, it is not possible to cancel the original reserved hosts because it can seriously impact the application.\n\nThe codes you pointed are for checking this condition. So I think it\u0027s needed.","commit_id":"a3b4850b6550ba0605d049f634d977f8a25605a1"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"a3a3a62498e961621be0451847bff22550b68edd","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                        pool \u003d rp.ReservationPool()"},{"line_number":129,"context_line":"                        hosts_in_pool.extend(pool.get_computehosts("},{"line_number":130,"context_line":"                            host_reservation[\u0027aggregate_id\u0027]))"},{"line_number":131,"context_line":"                    if (hosts_in_pool and"},{"line_number":132,"context_line":"                            self.nova.hypervisors.get("},{"line_number":133,"context_line":"                                self._get_hypervisor_from_name_or_id("},{"line_number":134,"context_line":"                                    allocation[\u0027compute_host_id\u0027])"},{"line_number":135,"context_line":"                            ).__dict__[\u0027running_vms\u0027] \u003e 0):"},{"line_number":136,"context_line":"                        raise manager_ex.NotEnoughHostsAvailable()"},{"line_number":137,"context_line":"            if allocations:"},{"line_number":138,"context_line":"                host_ids \u003d self._matching_hosts("},{"line_number":139,"context_line":"                    host_reservation[\u0027hypervisor_properties\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_c6f04e94","line":136,"range":{"start_line":131,"start_character":0,"end_line":136,"end_character":66},"in_reply_to":"ff0f0b1f_2ac7ef66","updated":"2017-05-23 06:40:28.000000000","message":"Here, the host plugin checks if the lease has started by checking if hosts are in the aggregate. It raises an exception if any instances are running on the reserved hosts. However, this condition check is not enough. I\u0027ve added my concern as a TODO comment.","commit_id":"a3b4850b6550ba0605d049f634d977f8a25605a1"}]}
