)]}'
{"zun/api/controllers/v1/containers.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"4a2e00fb4f70396b6172f28a43b1a03f699000a0","unresolved":false,"context_lines":[{"line_number":309,"context_line":"            \"\"\""},{"line_number":310,"context_line":"            context \u003d pecan.request.context"},{"line_number":311,"context_line":"            policy.enforce(context, \"container:run\","},{"line_number":312,"context_line":"                           action\u003d\"container:run\")"},{"line_number":313,"context_line":"            container_dict \u003d Container(**container_dict).as_dict()"},{"line_number":314,"context_line":"            container_dict[\u0027project_id\u0027] \u003d context.project_id"},{"line_number":315,"context_line":"            container_dict[\u0027user_id\u0027] \u003d context.user_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_d4438540","line":312,"range":{"start_line":312,"start_character":45,"end_line":312,"end_character":48},"updated":"2016-12-26 22:53:35.000000000","message":"I think it is better to consolidate two policies into one as well. That is simply replacing \"container:run\" with \"container:create\" here.","commit_id":"7b3562300dbfb874eff179cfcf477f434e5c4b4e"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"4a2e00fb4f70396b6172f28a43b1a03f699000a0","unresolved":false,"context_lines":[{"line_number":319,"context_line":"            container_dict[\u0027status\u0027] \u003d fields.ContainerStatus.CREATING"},{"line_number":320,"context_line":"            new_container \u003d objects.Container(context, **container_dict)"},{"line_number":321,"context_line":"            new_container.create(context)"},{"line_number":322,"context_line":"            pecan.request.rpcapi.container_run(context, new_container)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"            # Set the HTTP Location Header"},{"line_number":325,"context_line":"            pecan.response.location \u003d link.build_url(\u0027containers\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_b471a1aa","line":322,"range":{"start_line":322,"start_character":33,"end_line":322,"end_character":46},"updated":"2016-12-26 22:53:35.000000000","message":"I think you can shrink the \"if run ... else ...\" to here tp consolidate the duplicated codes. That is:\n\ndef post(...):\n  ...\n  if run:\n    pecan.request.rpcapi.container_run(...)\n  else:\n    pecan.request.rpcapi.container_create(...)\n  ...","commit_id":"7b3562300dbfb874eff179cfcf477f434e5c4b4e"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"4a2e00fb4f70396b6172f28a43b1a03f699000a0","unresolved":false,"context_lines":[{"line_number":338,"context_line":"            # NOTE(mkrai): Intent here is to check the existence of image"},{"line_number":339,"context_line":"            # before proceeding to create container. If image is not found,"},{"line_number":340,"context_line":"            # container create will fail with 400 status."},{"line_number":341,"context_line":"            images \u003d pecan.request.rpcapi.image_search(context,"},{"line_number":342,"context_line":"                                                       container_dict[\u0027image\u0027],"},{"line_number":343,"context_line":"                                                       exact_match\u003dTrue)"},{"line_number":344,"context_line":"            if not images:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da4df55a_f467a9e6","line":341,"range":{"start_line":341,"start_character":42,"end_line":341,"end_character":54},"updated":"2016-12-26 22:53:35.000000000","message":"I think this search apply to \"run\" as well.","commit_id":"7b3562300dbfb874eff179cfcf477f434e5c4b4e"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"4b2ef9c3ce6901290802d183fcce59ef4f3679e4","unresolved":false,"context_lines":[{"line_number":304,"context_line":"    def post(self, run\u003dFalse, **container_dict):"},{"line_number":305,"context_line":"            \"\"\"Create a new container."},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"             Create and starts a new container if run\u003dtrue"},{"line_number":308,"context_line":"            :param container: a container within the request body."},{"line_number":309,"context_line":"            \"\"\""},{"line_number":310,"context_line":"            context \u003d pecan.request.context"}],"source_content_type":"text/x-python","patch_set":5,"id":"da4df55a_830c5cee","line":307,"range":{"start_line":307,"start_character":13,"end_line":307,"end_character":58},"updated":"2016-12-27 07:20:49.000000000","message":"Replace it with:\n\n:param run: if true, starts the container","commit_id":"a21f5890ea930de8dfe596795a65c657284fa4d4"}],"zun/tests/unit/api/controllers/v1/test_containers.py":[{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"5aabc16da8985fcb8f083a3d93f876b27b951a8f","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        params \u003d (\u0027{\"name\": \"MyDocker\", \"image\": \"ubuntu\",\u0027"},{"line_number":34,"context_line":"                  \u0027\"command\": \"env\", \"memory\": \"512\",\u0027"},{"line_number":35,"context_line":"                  \u0027\"environment\": {\"key1\": \"val1\", \"key2\": \"val2\"}}\u0027)"},{"line_number":36,"context_line":"        response \u003d self.app.post(\u0027/v1/containers/?run\u003dtrue\u0027,"},{"line_number":37,"context_line":"                                 params\u003dparams,"},{"line_number":38,"context_line":"                                 content_type\u003d\u0027application/json\u0027)"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_a0ece8f3","line":36,"updated":"2016-12-27 15:50:43.000000000","message":"if you change it further i would prefer, \u0027/v1/containers/?run\u003dtrue\u0027 to be changed to \u0027/v1/containers?run\u003dtrue\u0027","commit_id":"75c414d01ab1f776b09fa7e8d2c7112dbdf8ecf5"},{"author":{"_account_id":20858,"name":"prameswar","email":"engg.pram1@gmail.com","username":"prameswar"},"change_message_id":"b0432605b2a9de7e877241cdc1470581b7b40515","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        params \u003d (\u0027{\"name\": \"MyDocker\", \"image\": \"ubuntu\",\u0027"},{"line_number":34,"context_line":"                  \u0027\"command\": \"env\", \"memory\": \"512\",\u0027"},{"line_number":35,"context_line":"                  \u0027\"environment\": {\"key1\": \"val1\", \"key2\": \"val2\"}}\u0027)"},{"line_number":36,"context_line":"        response \u003d self.app.post(\u0027/v1/containers/?run\u003dtrue\u0027,"},{"line_number":37,"context_line":"                                 params\u003dparams,"},{"line_number":38,"context_line":"                                 content_type\u003d\u0027application/json\u0027)"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_00e694af","line":36,"in_reply_to":"da4df55a_a0ece8f3","updated":"2016-12-27 16:05:11.000000000","message":"Done","commit_id":"75c414d01ab1f776b09fa7e8d2c7112dbdf8ecf5"}]}
