)]}'
{"zun/api/controllers/v1/containers.py":[{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"7b1a3468485b9d7f857e140a4613b0dd3c9521f1","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        context \u003d pecan.request.context"},{"line_number":303,"context_line":"        container \u003d _get_container(container_id)"},{"line_number":304,"context_line":"        check_policy_on_container(container.as_dict(), \"container:update\")"},{"line_number":305,"context_line":"        context \u003d pecan.request.context"},{"line_number":306,"context_line":"        try:"},{"line_number":307,"context_line":"            patch \u003d kwargs.get(\u0027patch\u0027)"},{"line_number":308,"context_line":"            container_dict \u003d container.as_dict()"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5201f7_6148b65c","line":305,"updated":"2017-01-10 09:12:13.000000000","message":"Same is there on line #320, why again?","commit_id":"e3f9f4ca0d16f9304e256922fc00624e3ef29536"},{"author":{"_account_id":13248,"name":"Wenzhi Yu","email":"wenzhi_yu@163.com","username":"yuywz"},"change_message_id":"4c684c98ac4ef7876efb0abdb7496b67f6ea6e60","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        context \u003d pecan.request.context"},{"line_number":303,"context_line":"        container \u003d _get_container(container_id)"},{"line_number":304,"context_line":"        check_policy_on_container(container.as_dict(), \"container:update\")"},{"line_number":305,"context_line":"        context \u003d pecan.request.context"},{"line_number":306,"context_line":"        try:"},{"line_number":307,"context_line":"            patch \u003d kwargs.get(\u0027patch\u0027)"},{"line_number":308,"context_line":"            container_dict \u003d container.as_dict()"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5201f7_0747cc1d","line":305,"in_reply_to":"ba5201f7_6148b65c","updated":"2017-01-11 02:53:12.000000000","message":"Done","commit_id":"e3f9f4ca0d16f9304e256922fc00624e3ef29536"}],"zun/container/docker/driver.py":[{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"7b1a3468485b9d7f857e140a4613b0dd3c9521f1","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            response \u003d docker.create_container(image, **kwargs)"},{"line_number":92,"context_line":"            container.container_id \u003d response[\u0027Id\u0027]"},{"line_number":93,"context_line":"            container.status \u003d fields.ContainerStatus.STOPPED"},{"line_number":94,"context_line":"            container.save(context)"},{"line_number":95,"context_line":"            return container"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def delete(self, container, force):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5201f7_e1458617","line":94,"updated":"2017-01-10 09:12:13.000000000","message":"I think we can remove this save, do you have any idea why this is here? Same thing is done in compute.py too after create. Please suggest.","commit_id":"e3f9f4ca0d16f9304e256922fc00624e3ef29536"},{"author":{"_account_id":13248,"name":"Wenzhi Yu","email":"wenzhi_yu@163.com","username":"yuywz"},"change_message_id":"4c684c98ac4ef7876efb0abdb7496b67f6ea6e60","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            response \u003d docker.create_container(image, **kwargs)"},{"line_number":92,"context_line":"            container.container_id \u003d response[\u0027Id\u0027]"},{"line_number":93,"context_line":"            container.status \u003d fields.ContainerStatus.STOPPED"},{"line_number":94,"context_line":"            container.save(context)"},{"line_number":95,"context_line":"            return container"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def delete(self, container, force):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5201f7_c7ea24ac","line":94,"in_reply_to":"ba5201f7_9b433e6c","updated":"2017-01-11 02:53:12.000000000","message":"@Pradeep, I think this \u0027save\u0027 is to ensure the change of container attributes(container_id and status) can be reflected in DB immediately. You can see in Zun code, once the attribute of an object is modified, a \u0027save\u0027 will be called, this idea is borrowed from Nova I assume. But I agree that containers are different from VMs, the creation process of containers is much faster than VMs, so maybe we do not need to refresh the data stored in DB as frequently as Nova does.","commit_id":"e3f9f4ca0d16f9304e256922fc00624e3ef29536"},{"author":{"_account_id":13248,"name":"Wenzhi Yu","email":"wenzhi_yu@163.com","username":"yuywz"},"change_message_id":"273afa77262e8dfb8caa74157be16abf9fd35ff6","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            response \u003d docker.create_container(image, **kwargs)"},{"line_number":92,"context_line":"            container.container_id \u003d response[\u0027Id\u0027]"},{"line_number":93,"context_line":"            container.status \u003d fields.ContainerStatus.STOPPED"},{"line_number":94,"context_line":"            container.save(context)"},{"line_number":95,"context_line":"            return container"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def delete(self, container, force):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5201f7_ed7c6922","line":94,"in_reply_to":"ba5201f7_ada50105","updated":"2017-01-11 03:22:17.000000000","message":"I see.","commit_id":"e3f9f4ca0d16f9304e256922fc00624e3ef29536"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"e81d17aebf76d2410011fea970948640f8f45804","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            response \u003d docker.create_container(image, **kwargs)"},{"line_number":92,"context_line":"            container.container_id \u003d response[\u0027Id\u0027]"},{"line_number":93,"context_line":"            container.status \u003d fields.ContainerStatus.STOPPED"},{"line_number":94,"context_line":"            container.save(context)"},{"line_number":95,"context_line":"            return container"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def delete(self, container, force):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5201f7_ada50105","line":94,"in_reply_to":"ba5201f7_c7ea24ac","updated":"2017-01-11 03:09:02.000000000","message":"I think @Pradeep mean there is another call to save() in compute manager (https://github.com/openstack/zun/blob/master/zun/compute/manager.py#L121), which looks duplicated to this one. Therefore, one of them needs to be removed. However, this is irrelevant to what this patch is doing, so treat it as an optional fix.","commit_id":"e3f9f4ca0d16f9304e256922fc00624e3ef29536"},{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"efacc825b1030b7cacfc3faa0da458dae6a35887","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            response \u003d docker.create_container(image, **kwargs)"},{"line_number":92,"context_line":"            container.container_id \u003d response[\u0027Id\u0027]"},{"line_number":93,"context_line":"            container.status \u003d fields.ContainerStatus.STOPPED"},{"line_number":94,"context_line":"            container.save(context)"},{"line_number":95,"context_line":"            return container"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def delete(self, container, force):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5201f7_9b433e6c","line":94,"in_reply_to":"ba5201f7_e1458617","updated":"2017-01-10 10:54:19.000000000","message":"small correction in my comment, s/compute/manager/","commit_id":"e3f9f4ca0d16f9304e256922fc00624e3ef29536"}],"zun/db/etcd/api.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"64807df83de642e96e5414ac203d7108e74380e9","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            raise exception.ContainerAlreadyExists(field\u003d\u0027name\u0027,"},{"line_number":189,"context_line":"                                                   value\u003dlowername)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    @lockutils.synchronized(\u0027etcd_container\u0027)"},{"line_number":192,"context_line":"    def create_container(self, context, container_data):"},{"line_number":193,"context_line":"        # ensure defaults are present for new containers"},{"line_number":194,"context_line":"        if not container_data.get(\u0027uuid\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5201f7_4ff666fa","line":191,"range":{"start_line":191,"start_character":15,"end_line":191,"end_character":27},"updated":"2017-01-10 15:21:58.000000000","message":"@Wenzhi,\n\nIt looks this is needed because etcd doesn\u0027t have built-in support for locking and concurrency control? This is OK for now, but for long-term, perhaps we need to switch to etcd\u0027s mini-transaction introduced in etcd3: https://coreos.com/blog/transactional-memory-with-etcd3.html .","commit_id":"e3f9f4ca0d16f9304e256922fc00624e3ef29536"},{"author":{"_account_id":13248,"name":"Wenzhi Yu","email":"wenzhi_yu@163.com","username":"yuywz"},"change_message_id":"4c684c98ac4ef7876efb0abdb7496b67f6ea6e60","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            raise exception.ContainerAlreadyExists(field\u003d\u0027name\u0027,"},{"line_number":189,"context_line":"                                                   value\u003dlowername)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    @lockutils.synchronized(\u0027etcd_container\u0027)"},{"line_number":192,"context_line":"    def create_container(self, context, container_data):"},{"line_number":193,"context_line":"        # ensure defaults are present for new containers"},{"line_number":194,"context_line":"        if not container_data.get(\u0027uuid\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5201f7_cad4ebbe","line":191,"range":{"start_line":191,"start_character":15,"end_line":191,"end_character":27},"in_reply_to":"ba5201f7_4ff666fa","updated":"2017-01-11 02:53:12.000000000","message":"Yes indeed, no doubt we should migrate to etcd API v3. But the python-etcd3 client is not stable currently, I registered a bp [1] to track this and will migrate to python-etcd3 once it\u0027s stable.\n[1] https://blueprints.launchpad.net/zun/+spec/etcd-api-v3","commit_id":"e3f9f4ca0d16f9304e256922fc00624e3ef29536"}]}
