)]}'
{"zun/compute/api.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"5ff74d30622f1011e30e4abff71627112f6e2f6d","unresolved":false,"context_lines":[{"line_number":142,"context_line":"    def add_security_group(self, context, container, security_group):"},{"line_number":143,"context_line":"        self._record_action_start(context, container,"},{"line_number":144,"context_line":"                                  container_actions.ADD_SECURITY_GROUP)"},{"line_number":145,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":146,"context_line":"            network_api \u003d zun_network.api(context\u003dcontext,"},{"line_number":147,"context_line":"                                          docker_api\u003ddocker)"},{"line_number":148,"context_line":"        return network_api.add_security_groups_to_ports(container,"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_1f0819d7","line":145,"range":{"start_line":145,"start_character":26,"end_line":145,"end_character":39},"updated":"2018-03-22 02:13:32.000000000","message":"This code is run on a controller node, which possibly don\u0027t have a docker installed (docker are installed on compute nodes). Therefore, we need to avoid initializing a docker client in here.","commit_id":"a8636adea2bc27cf2c483988b1357ae8fa82021c"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"5ff74d30622f1011e30e4abff71627112f6e2f6d","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        self._record_action_start(context, container,"},{"line_number":144,"context_line":"                                  container_actions.ADD_SECURITY_GROUP)"},{"line_number":145,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":146,"context_line":"            network_api \u003d zun_network.api(context\u003dcontext,"},{"line_number":147,"context_line":"                                          docker_api\u003ddocker)"},{"line_number":148,"context_line":"        return network_api.add_security_groups_to_ports(container,"},{"line_number":149,"context_line":"                                                     [security_group])"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_5f99b176","line":146,"range":{"start_line":146,"start_character":12,"end_line":146,"end_character":23},"updated":"2018-03-22 02:13:32.000000000","message":"We\u0027d better to avoid using zun_network.api because this module requires a reference of docker client which cannot be satisfied due to the reason I commented above.","commit_id":"a8636adea2bc27cf2c483988b1357ae8fa82021c"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"5ff74d30622f1011e30e4abff71627112f6e2f6d","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":146,"context_line":"            network_api \u003d zun_network.api(context\u003dcontext,"},{"line_number":147,"context_line":"                                          docker_api\u003ddocker)"},{"line_number":148,"context_line":"        return network_api.add_security_groups_to_ports(container,"},{"line_number":149,"context_line":"                                                     [security_group])"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def remove_security_group(self, context, container, *args):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_bf832d04","line":148,"range":{"start_line":148,"start_character":27,"end_line":148,"end_character":55},"updated":"2018-03-22 02:13:32.000000000","message":"Because we want to avoid network_api, we possibly need to move the method \u0027add_security_groups_to_ports\u0027 to another module (consider moving it to zun/zun/network/neutron.py).","commit_id":"a8636adea2bc27cf2c483988b1357ae8fa82021c"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"5ff74d30622f1011e30e4abff71627112f6e2f6d","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            network_api \u003d zun_network.api(context\u003dcontext,"},{"line_number":147,"context_line":"                                          docker_api\u003ddocker)"},{"line_number":148,"context_line":"        return network_api.add_security_groups_to_ports(container,"},{"line_number":149,"context_line":"                                                     [security_group])"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def remove_security_group(self, context, container, *args):"},{"line_number":152,"context_line":"        self._record_action_start(context, container,"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_ff8e8525","line":149,"updated":"2018-03-22 02:13:32.000000000","message":"Eventually, we need to update the security_groups filed in the container object, as how we did in  https://github.com/openstack/zun/blob/master/zun/compute/manager.py#L493","commit_id":"a8636adea2bc27cf2c483988b1357ae8fa82021c"}],"zun/compute/rpcapi.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"8a80e7fcb5f5479283ea67359f7741a9d38a78db","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                          container\u003dcontainer, repository\u003drepository, tag\u003dtag)"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    # def add_security_group(self, context, container, security_group):"},{"line_number":159,"context_line":"    #     return self._cast(container.host, \u0027add_security_group\u0027,"},{"line_number":160,"context_line":"    #                       container\u003dcontainer, security_group\u003dsecurity_group)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def remove_security_group(self, context, container, security_group):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_c64afcaa","line":159,"range":{"start_line":159,"start_character":45,"end_line":159,"end_character":63},"updated":"2018-03-27 15:27:33.000000000","message":"Keep in mind that the \u0027add_security_group\u0027 method needs to be removed from compute manager as well: https://github.com/openstack/zun/blob/master/zun/compute/manager.py#L504","commit_id":"193d68d409103890a18bc979d6ef8c1d0bba0b6d"}],"zun/network/neutron.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"8a80e7fcb5f5479283ea67359f7741a9d38a78db","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            raise exception.PortBindingFailed(port\u003dport[\u0027id\u0027])"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def add_security_groups_to_ports(self, container, security_group_ids):"},{"line_number":111,"context_line":"        container_id \u003d container.get_sandbox_id()"},{"line_number":112,"context_line":"        if not container_id:"},{"line_number":113,"context_line":"            container_id \u003d container.container_id"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        port_ids \u003d set()"},{"line_number":116,"context_line":"        for addrs_list in container.addresses.values():"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_a6e4a8ad","line":113,"range":{"start_line":111,"start_character":0,"end_line":113,"end_character":49},"updated":"2018-03-27 15:27:33.000000000","message":"I think these lines can be removed because container_id is not used anywhere.","commit_id":"193d68d409103890a18bc979d6ef8c1d0bba0b6d"}],"zun/tests/unit/network/test_kuryr_network.py":[{"author":{"_account_id":25695,"name":"Deepak Mourya","email":"deepakmoriya7@gmail.com","username":"deepak_mourya"},"change_message_id":"0e88b63db6083c94d6e024dabcfdefd1b9ee5755","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        self.network_api.neutron_api.context \u003d mock.Mock()"},{"line_number":189,"context_line":"        security_group_ids \u003d [\u0027sg2\u0027]"},{"line_number":190,"context_line":"        self.neutron_api.add_security_groups_to_ports(container,"},{"line_number":191,"context_line":"                                                 security_group_ids)"},{"line_number":192,"context_line":"        mock_neutron_api.update_port.assert_called_once_with("},{"line_number":193,"context_line":"            \u00271234567\u0027,"},{"line_number":194,"context_line":"            {\u0027port\u0027: {\u0027security_groups\u0027: [\u0027sg1\u0027, \u0027sg2\u0027]}})"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf659307_6e3eb0db","line":191,"updated":"2018-04-05 03:13:28.000000000","message":"Looks good but just a nit required that two space is needed here.","commit_id":"5744698302ee42cb255d6cbff6e3fa3a3e8e1caf"}]}
