)]}'
{"blazar/db/sqlalchemy/utils.py":[{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"9ee4375d87444c0e0df39bd8b3d0b216c6995c8b","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        yield lease"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def get_reservation_by_host_id(host_id, start_date, end_date):"},{"line_number":61,"context_line":"    reservation \u003d []"},{"line_number":62,"context_line":"    for lease in _get_leases_from_host_id(host_id, start_date, end_date):"},{"line_number":63,"context_line":"        reservation.extend(lease.reservations)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_d152f8dd","line":60,"range":{"start_line":60,"start_character":8,"end_line":60,"end_character":19},"updated":"2017-07-07 05:57:33.000000000","message":"Isn\u0027t it better to be \u0027reservations\u0027 because a host can belong to multiple reservations.","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"23b077077ace5e7960958d4a160c599536210593","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        yield lease"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def get_reservation_by_host_id(host_id, start_date, end_date):"},{"line_number":61,"context_line":"    reservation \u003d []"},{"line_number":62,"context_line":"    for lease in _get_leases_from_host_id(host_id, start_date, end_date):"},{"line_number":63,"context_line":"        reservation.extend(lease.reservations)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_8c16a6a7","line":60,"range":{"start_line":60,"start_character":8,"end_line":60,"end_character":19},"in_reply_to":"3f1d235d_d152f8dd","updated":"2017-07-07 10:19:17.000000000","message":"Done","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"9ee4375d87444c0e0df39bd8b3d0b216c6995c8b","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def get_reservation_by_host_id(host_id, start_date, end_date):"},{"line_number":61,"context_line":"    reservation \u003d []"},{"line_number":62,"context_line":"    for lease in _get_leases_from_host_id(host_id, start_date, end_date):"},{"line_number":63,"context_line":"        reservation.extend(lease.reservations)"},{"line_number":64,"context_line":"    return reservation"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def get_free_periods(resource_id, start_date, end_date, duration):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_d1c79863","line":64,"range":{"start_line":62,"start_character":4,"end_line":64,"end_character":22},"updated":"2017-07-07 05:57:33.000000000","message":"It can return wrong information if the lease has multiple reservations. e.g. Assume that a lease has reservation A and reservation B, and a host belongs to reservation B. In this case, only the reservation B should be returned but current implementation returns both of reservation A and B.","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"23b077077ace5e7960958d4a160c599536210593","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def get_reservation_by_host_id(host_id, start_date, end_date):"},{"line_number":61,"context_line":"    reservation \u003d []"},{"line_number":62,"context_line":"    for lease in _get_leases_from_host_id(host_id, start_date, end_date):"},{"line_number":63,"context_line":"        reservation.extend(lease.reservations)"},{"line_number":64,"context_line":"    return reservation"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def get_free_periods(resource_id, start_date, end_date, duration):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_f8e830e2","line":64,"range":{"start_line":62,"start_character":4,"end_line":64,"end_character":22},"in_reply_to":"3f1d235d_d1c79863","updated":"2017-07-07 10:19:17.000000000","message":"You\u0027re right. I\u0027ll update it.","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"}],"blazar/plugins/instances/instance_plugin.py":[{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"9ee4375d87444c0e0df39bd8b3d0b216c6995c8b","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        return 0, 0, 0"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def pickup_hosts(self, cpus, memory, disk, amount, start_date, end_date):"},{"line_number":65,"context_line":"        \"\"\"Checks whether Blazar can accomodate the request."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        This method filters and pick up hosts for this reservation"},{"line_number":68,"context_line":"        with following steps."}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_71520415","line":65,"range":{"start_line":65,"start_character":37,"end_line":65,"end_character":47},"updated":"2017-07-07 05:57:33.000000000","message":"accommodate","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"23b077077ace5e7960958d4a160c599536210593","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        return 0, 0, 0"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def pickup_hosts(self, cpus, memory, disk, amount, start_date, end_date):"},{"line_number":65,"context_line":"        \"\"\"Checks whether Blazar can accomodate the request."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        This method filters and pick up hosts for this reservation"},{"line_number":68,"context_line":"        with following steps."}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_4cdbee4d","line":65,"range":{"start_line":65,"start_character":37,"end_line":65,"end_character":47},"in_reply_to":"3f1d235d_71520415","updated":"2017-07-07 10:19:17.000000000","message":"Done","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"9ee4375d87444c0e0df39bd8b3d0b216c6995c8b","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        This method filters and pick up hosts for this reservation"},{"line_number":68,"context_line":"        with following steps."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        1. filter hosts that have a spec enough to accomodate the flavor"},{"line_number":71,"context_line":"        2. categorize hosts allocated_hosts and not_allocated_hosts"},{"line_number":72,"context_line":"           at the reservation time frame"},{"line_number":73,"context_line":"        3. filter out hosts used by physical host reservation from"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_31580c2f","line":70,"range":{"start_line":70,"start_character":51,"end_line":70,"end_character":61},"updated":"2017-07-07 05:57:33.000000000","message":"ditto","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"23b077077ace5e7960958d4a160c599536210593","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        This method filters and pick up hosts for this reservation"},{"line_number":68,"context_line":"        with following steps."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        1. filter hosts that have a spec enough to accomodate the flavor"},{"line_number":71,"context_line":"        2. categorize hosts allocated_hosts and not_allocated_hosts"},{"line_number":72,"context_line":"           at the reservation time frame"},{"line_number":73,"context_line":"        3. filter out hosts used by physical host reservation from"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_0ce976e4","line":70,"range":{"start_line":70,"start_character":51,"end_line":70,"end_character":61},"in_reply_to":"3f1d235d_31580c2f","updated":"2017-07-07 10:19:17.000000000","message":"Done","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"9ee4375d87444c0e0df39bd8b3d0b216c6995c8b","unresolved":false,"context_lines":[{"line_number":72,"context_line":"           at the reservation time frame"},{"line_number":73,"context_line":"        3. filter out hosts used by physical host reservation from"},{"line_number":74,"context_line":"           allocate_host"},{"line_number":75,"context_line":"        4. filter out hosts that can\u0027t accomodate the flavor at the"},{"line_number":76,"context_line":"           time frame because of others reservations"},{"line_number":77,"context_line":"        \"\"\""},{"line_number":78,"context_line":"        flavor_definitions \u003d ["}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_1143d043","line":75,"range":{"start_line":75,"start_character":39,"end_line":75,"end_character":49},"updated":"2017-07-07 05:57:33.000000000","message":"ditto","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"23b077077ace5e7960958d4a160c599536210593","unresolved":false,"context_lines":[{"line_number":72,"context_line":"           at the reservation time frame"},{"line_number":73,"context_line":"        3. filter out hosts used by physical host reservation from"},{"line_number":74,"context_line":"           allocate_host"},{"line_number":75,"context_line":"        4. filter out hosts that can\u0027t accomodate the flavor at the"},{"line_number":76,"context_line":"           time frame because of others reservations"},{"line_number":77,"context_line":"        \"\"\""},{"line_number":78,"context_line":"        flavor_definitions \u003d ["}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_cceedeeb","line":75,"range":{"start_line":75,"start_character":39,"end_line":75,"end_character":49},"in_reply_to":"3f1d235d_1143d043","updated":"2017-07-07 10:19:17.000000000","message":"Done","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"9ee4375d87444c0e0df39bd8b3d0b216c6995c8b","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            return host_ids[:int(amount)]"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            raise mgr_exceptions.HostNotFound(\"The reservation can\u0027t be \""},{"line_number":111,"context_line":"                                              \"accomodate because of less \""},{"line_number":112,"context_line":"                                              \"capacity.\")"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def reserve_resource(self, reservation_id, values):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_91780090","line":111,"range":{"start_line":111,"start_character":47,"end_line":111,"end_character":57},"updated":"2017-07-07 05:57:33.000000000","message":"ditto","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"23b077077ace5e7960958d4a160c599536210593","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            return host_ids[:int(amount)]"},{"line_number":109,"context_line":"        else:"},{"line_number":110,"context_line":"            raise mgr_exceptions.HostNotFound(\"The reservation can\u0027t be \""},{"line_number":111,"context_line":"                                              \"accomodate because of less \""},{"line_number":112,"context_line":"                                              \"capacity.\")"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def reserve_resource(self, reservation_id, values):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f1d235d_ace962e3","line":111,"range":{"start_line":111,"start_character":47,"end_line":111,"end_character":57},"in_reply_to":"3f1d235d_91780090","updated":"2017-07-07 10:19:17.000000000","message":"Done","commit_id":"8e4e9cb1ccbb51d8746dc76d81bd2fa53e6de370"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"2149bf1ba767355cef66d736a756b4baeb8fa7cc","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    def reserve_resource(self, reservation_id, values):"},{"line_number":115,"context_line":"        # TODO(masahito) the instance reservation plugin only supports"},{"line_number":116,"context_line":"        # anti-affinity rule in short-term goal."},{"line_number":117,"context_line":"        if bool_from_string(values[\u0027affinity\u0027]):"},{"line_number":118,"context_line":"            raise exceptions.BlazarException(\u0027affinity \u003d True is not \u0027"},{"line_number":119,"context_line":"                                             \u0027supported.\u0027)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        host_ids \u003d self.pickup_hosts(values[\u0027vcpus\u0027], values[\u0027memory_mb\u0027],"},{"line_number":122,"context_line":"                                     values[\u0027disk_gb\u0027], values[\u0027amount\u0027],"},{"line_number":123,"context_line":"                                     values[\u0027start_date\u0027], values[\u0027end_date\u0027])"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        instance_reservation_val \u003d {"},{"line_number":126,"context_line":"            \u0027reservation_id\u0027: reservation_id,"},{"line_number":127,"context_line":"            \u0027vcpus\u0027: values[\u0027vcpus\u0027],"},{"line_number":128,"context_line":"            \u0027memory_mb\u0027: values[\u0027memory_mb\u0027],"},{"line_number":129,"context_line":"            \u0027disk_gb\u0027: values[\u0027disk_gb\u0027],"},{"line_number":130,"context_line":"            \u0027amount\u0027: values[\u0027amount\u0027],"},{"line_number":131,"context_line":"            \u0027affinity\u0027: bool_from_string(values[\u0027affinity\u0027]),"},{"line_number":132,"context_line":"            }"},{"line_number":133,"context_line":"        instance_reservation \u003d db_api.instance_reservation_create("},{"line_number":134,"context_line":"            instance_reservation_val)"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ff346bd7_59d497bd","line":132,"range":{"start_line":117,"start_character":0,"end_line":132,"end_character":13},"updated":"2017-07-25 04:59:04.000000000","message":"Keys in values should be checked. I sent a request with invalid parameters, then 500 Internal server error was returned and related records were remained in the leases table, reservations table and events table. 400 MalformedParameter error should be returned instead and related records should be cleaned.","commit_id":"9f0a611507f5ff487b2783973ab3cca9942959aa"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"f67bd5c10c26c2505753b0dac81009aa4dab4111","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    def reserve_resource(self, reservation_id, values):"},{"line_number":115,"context_line":"        # TODO(masahito) the instance reservation plugin only supports"},{"line_number":116,"context_line":"        # anti-affinity rule in short-term goal."},{"line_number":117,"context_line":"        if bool_from_string(values[\u0027affinity\u0027]):"},{"line_number":118,"context_line":"            raise exceptions.BlazarException(\u0027affinity \u003d True is not \u0027"},{"line_number":119,"context_line":"                                             \u0027supported.\u0027)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        host_ids \u003d self.pickup_hosts(values[\u0027vcpus\u0027], values[\u0027memory_mb\u0027],"},{"line_number":122,"context_line":"                                     values[\u0027disk_gb\u0027], values[\u0027amount\u0027],"},{"line_number":123,"context_line":"                                     values[\u0027start_date\u0027], values[\u0027end_date\u0027])"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        instance_reservation_val \u003d {"},{"line_number":126,"context_line":"            \u0027reservation_id\u0027: reservation_id,"},{"line_number":127,"context_line":"            \u0027vcpus\u0027: values[\u0027vcpus\u0027],"},{"line_number":128,"context_line":"            \u0027memory_mb\u0027: values[\u0027memory_mb\u0027],"},{"line_number":129,"context_line":"            \u0027disk_gb\u0027: values[\u0027disk_gb\u0027],"},{"line_number":130,"context_line":"            \u0027amount\u0027: values[\u0027amount\u0027],"},{"line_number":131,"context_line":"            \u0027affinity\u0027: bool_from_string(values[\u0027affinity\u0027]),"},{"line_number":132,"context_line":"            }"},{"line_number":133,"context_line":"        instance_reservation \u003d db_api.instance_reservation_create("},{"line_number":134,"context_line":"            instance_reservation_val)"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ff346bd7_084d6999","line":132,"range":{"start_line":117,"start_character":0,"end_line":132,"end_character":13},"in_reply_to":"ff346bd7_59d497bd","updated":"2017-07-26 07:30:06.000000000","message":"The invalid recodes wouldn\u0027t remain once the patch[1] is merged.  But 500 response code is not good. I\u0027ll add the key validation here.\n\n1. https://review.openstack.org/#/c/481518/","commit_id":"9f0a611507f5ff487b2783973ab3cca9942959aa"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"4db4d919120bca50e24281f57ed17d3949b04bdd","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                                                                end_date)"},{"line_number":51,"context_line":"            if reservations \u003d\u003d []:"},{"line_number":52,"context_line":"                free.append({\u0027host\u0027: host, \u0027reservations\u0027: None})"},{"line_number":53,"context_line":"            elif len(filter(lambda x: x[\u0027resource_type\u0027] \u003d\u003d"},{"line_number":54,"context_line":"                            oshosts.RESOURCE_TYPE, reservations)) \u003d\u003d 0:"},{"line_number":55,"context_line":"                non_free.append({\u0027host\u0027: host, \u0027reservations\u0027: reservations})"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        return free, non_free"}],"source_content_type":"text/x-python","patch_set":11,"id":"bf3e73b7_dd9adac3","line":54,"range":{"start_line":53,"start_character":0,"end_line":54,"end_character":71},"updated":"2017-08-07 09:44:41.000000000","message":"More pythonic syntax:\n\nelif not filter…","commit_id":"b2956a4ddc7741d491bbf8c34cab9e4954a8c50e"}]}
