)]}'
{"zun/compute/manager.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"f81c08bd05e30d90fccca46e858b512ab70019fc","unresolved":false,"context_lines":[{"line_number":649,"context_line":"    @periodic_task.periodic_task(run_immediately\u003dTrue)"},{"line_number":650,"context_line":"    def delete_unused_containers(self, context):"},{"line_number":651,"context_line":"        \"\"\"Delete container with status DELETED\"\"\""},{"line_number":652,"context_line":"        containers \u003d objects.Container.list(context)"},{"line_number":653,"context_line":"        if containers:"},{"line_number":654,"context_line":"            for container in containers:"},{"line_number":655,"context_line":"                # NOTE(kiennt): objects.Container.list with filters doesn\u0027t"}],"source_content_type":"text/x-python","patch_set":14,"id":"ff346bd7_6f1a5817","line":652,"range":{"start_line":652,"start_character":39,"end_line":652,"end_character":43},"updated":"2017-07-28 15:00:58.000000000","message":"Hi @Kiennt,\n\nI checked yesterday\u0027s IRC log and saw you raised a question about why it cannot filter containers with DELETED status. I think it will work by adding \u0027status\u0027 to here: https://github.com/openstack/zun/blob/master/zun/db/sqlalchemy/api.py#L134","commit_id":"0c14425d39cb7475e1ae331d20ab2303d0a8a61a"}],"zun/service/periodic.py":[{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"0c4115ba4600ea074ee2687df3268675e98091ac","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def delete_container(self, ctx):"},{"line_number":60,"context_line":"        \"\"\"Delete container with status DELETED\"\"\""},{"line_number":61,"context_line":"        LOG.debug(\u0027Start deleting container with status DELETED.\u0027)"},{"line_number":62,"context_line":"        containers \u003d objects.Container.list(ctx)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        for container in containers:"},{"line_number":65,"context_line":"            if container.status \u003d\u003d consts.DELETED:"},{"line_number":66,"context_line":"                try:"},{"line_number":67,"context_line":"                    self.driver.delete(container, True)"},{"line_number":68,"context_line":"                    container.destroy(ctx)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_28cf6fb1","line":65,"range":{"start_line":62,"start_character":8,"end_line":65,"end_character":50},"updated":"2017-07-20 08:51:15.000000000","message":"rather than looping each container can we add filter here.\nhttps://github.com/openstack/zun/blob/master/zun/db/sqlalchemy/api.py#L130","commit_id":"77c9c3b9d616729908b5d5ec235232ef78a3ec39"},{"author":{"_account_id":22406,"name":"Kien Nguyen","email":"kiennt2609@gmail.com","username":"kiennt"},"change_message_id":"6f096db8b5b8e17c9c0823e085d1c1fe03a90cda","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def delete_container(self, ctx):"},{"line_number":60,"context_line":"        \"\"\"Delete container with status DELETED\"\"\""},{"line_number":61,"context_line":"        LOG.debug(\u0027Start deleting container with status DELETED.\u0027)"},{"line_number":62,"context_line":"        containers \u003d objects.Container.list(ctx)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        for container in containers:"},{"line_number":65,"context_line":"            if container.status \u003d\u003d consts.DELETED:"},{"line_number":66,"context_line":"                try:"},{"line_number":67,"context_line":"                    self.driver.delete(container, True)"},{"line_number":68,"context_line":"                    container.destroy(ctx)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_e8acd736","line":65,"range":{"start_line":62,"start_character":8,"end_line":65,"end_character":50},"in_reply_to":"1f1a1f67_28cf6fb1","updated":"2017-07-20 09:12:48.000000000","message":"+1, thank you.","commit_id":"77c9c3b9d616729908b5d5ec235232ef78a3ec39"},{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"0c4115ba4600ea074ee2687df3268675e98091ac","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                    msg \u003d (\u0027Complete deleting container %(container_name)s \u0027"},{"line_number":70,"context_line":"                           \u0027with status DELETED\u0027) % \\"},{"line_number":71,"context_line":"                        {\u0027container_name\u0027: container.name}"},{"line_number":72,"context_line":"                    LOG.debug(msg)"},{"line_number":73,"context_line":"                except errors.APIError as api_error:"},{"line_number":74,"context_line":"                    msg \u003d _(\u0027Can not delete container %(container_name)s \u0027"},{"line_number":75,"context_line":"                            \u0027because %(api_error)s error.\u0027) % \\"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_a84fff32","line":72,"range":{"start_line":72,"start_character":24,"end_line":72,"end_character":34},"updated":"2017-07-20 08:51:15.000000000","message":"since this will be rare case, can we increase the severity of log level, Thoughts?","commit_id":"77c9c3b9d616729908b5d5ec235232ef78a3ec39"},{"author":{"_account_id":22406,"name":"Kien Nguyen","email":"kiennt2609@gmail.com","username":"kiennt"},"change_message_id":"6f096db8b5b8e17c9c0823e085d1c1fe03a90cda","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                    msg \u003d (\u0027Complete deleting container %(container_name)s \u0027"},{"line_number":70,"context_line":"                           \u0027with status DELETED\u0027) % \\"},{"line_number":71,"context_line":"                        {\u0027container_name\u0027: container.name}"},{"line_number":72,"context_line":"                    LOG.debug(msg)"},{"line_number":73,"context_line":"                except errors.APIError as api_error:"},{"line_number":74,"context_line":"                    msg \u003d _(\u0027Can not delete container %(container_name)s \u0027"},{"line_number":75,"context_line":"                            \u0027because %(api_error)s error.\u0027) % \\"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_283e4fda","line":72,"range":{"start_line":72,"start_character":24,"end_line":72,"end_character":34},"in_reply_to":"1f1a1f67_a84fff32","updated":"2017-07-20 09:12:48.000000000","message":"I will increase log level and do the same with the previous method - sync_container_state.","commit_id":"77c9c3b9d616729908b5d5ec235232ef78a3ec39"},{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"0c4115ba4600ea074ee2687df3268675e98091ac","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                        {\u0027container_name\u0027: container.name}"},{"line_number":72,"context_line":"                    LOG.debug(msg)"},{"line_number":73,"context_line":"                except errors.APIError as api_error:"},{"line_number":74,"context_line":"                    msg \u003d _(\u0027Can not delete container %(container_name)s \u0027"},{"line_number":75,"context_line":"                            \u0027because %(api_error)s error.\u0027) % \\"},{"line_number":76,"context_line":"                        {\u0027container_name\u0027: container.name,"},{"line_number":77,"context_line":"                         \u0027api_error\u0027: api_error}"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_c8b6bb3f","line":74,"range":{"start_line":74,"start_character":26,"end_line":74,"end_character":28},"updated":"2017-07-20 08:51:15.000000000","message":"i think we don\u0027t need translation now.","commit_id":"77c9c3b9d616729908b5d5ec235232ef78a3ec39"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"c5200e23323f99a38c182eaca9c3add8113d1343","unresolved":false,"context_lines":[{"line_number":38,"context_line":"class ContainerPeriodicJob(periodic_task.PeriodicTasks):"},{"line_number":39,"context_line":"    def __init__(self, conf):"},{"line_number":40,"context_line":"        self.host \u003d conf.host"},{"line_number":41,"context_line":"        self.manager \u003d Manager(conf.container_driver)"},{"line_number":42,"context_line":"        self.node_tracker \u003d ComputeNodeTracker(self.host, self.manager.driver)"},{"line_number":43,"context_line":"        super(ContainerPeriodicJob, self).__init__(conf)"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"ff346bd7_a074e6cf","line":41,"range":{"start_line":41,"start_character":23,"end_line":41,"end_character":30},"updated":"2017-07-27 23:02:55.000000000","message":"I don\u0027t think it is a good idea to create another compute manager.","commit_id":"244c1ae5c1c91b2ac9cc065c9099a8c48d16a97c"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"c5200e23323f99a38c182eaca9c3add8113d1343","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    @periodic_task.periodic_task(run_immediately\u003dTrue)"},{"line_number":46,"context_line":"    @set_context"},{"line_number":47,"context_line":"    def delete_unused_container(self, ctx):"},{"line_number":48,"context_line":"        \"\"\"Delete container with status DELETED\"\"\""},{"line_number":49,"context_line":"        containers \u003d objects.Container.list(ctx,"},{"line_number":50,"context_line":"                                            filters\u003d{\u0027status\u0027: consts.DELETED})"}],"source_content_type":"text/x-python","patch_set":12,"id":"ff346bd7_60283e96","line":47,"range":{"start_line":47,"start_character":8,"end_line":47,"end_character":31},"updated":"2017-07-27 23:02:55.000000000","message":"How about moving this periodic task to zun compute manager: https://github.com/openstack/zun/blob/master/zun/compute/manager.py . If we can do that, we would be able to leverage all the methods inside the manager. Perhaps you could refer how Nova did it: https://github.com/openstack/nova/blob/master/nova/compute/manager.py . Just ping me in IRC or send me an email if you need any help.","commit_id":"244c1ae5c1c91b2ac9cc065c9099a8c48d16a97c"}]}
