)]}'
{"cyborg/agent/manager.py":[{"author":{"_account_id":30759,"name":"Shogo Saito","email":"shogo.saito.ac@hco.ntt.co.jp","username":"s.shogo"},"change_message_id":"7073e4382f0fd1a799db25e96213032b4d2cb838","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":53,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":54,"context_line":"        download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":55,"context_line":"                                                    prefix\u003dbitstream_uuid)"},{"line_number":56,"context_line":"        self.image_api.download(context,"},{"line_number":57,"context_line":"                                bitstream_uuid,"},{"line_number":58,"context_line":"                                dest_path\u003ddownload_path.name)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4c43b2_6602820d","line":55,"range":{"start_line":54,"start_character":8,"end_line":55,"end_character":74},"updated":"2020-04-20 04:11:41.000000000","message":"Type of download_path causes TypeError in os.remove(download_path), the end of fpga_program_v2().\nThe detail log in my env is below[1]\n\nIMHO, we can change the type here, or os.remove\u0027s argument, with str() and so on.\n\n[1] http://paste.openstack.org/show/792387/","commit_id":"38b990e5fc8a248c45f391671edf696508573260"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"909fe0f40b0f73c540492bede80e2098f0cb69aa","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":53,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":54,"context_line":"        download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":55,"context_line":"                                                    prefix\u003dbitstream_uuid)"},{"line_number":56,"context_line":"        self.image_api.download(context,"},{"line_number":57,"context_line":"                                bitstream_uuid,"},{"line_number":58,"context_line":"                                dest_path\u003ddownload_path.name)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f493fa4_53bfbafa","line":55,"range":{"start_line":54,"start_character":8,"end_line":55,"end_character":74},"in_reply_to":"3f4c43b2_6602820d","updated":"2020-04-21 11:54:42.000000000","message":"Done. I Replaced the file object with its name. \nand tested the following in my Python3 env, it should work now.\n\u003e\u003e\u003e import tempfile\n\u003e\u003e\u003e import uuid\n\u003e\u003e\u003e import os\n\u003e\u003e\u003e uuid.uuid4()\nUUID(\u00277e817df0-5e64-48c8-bf14-ab4d7f07c258\u0027)\n\u003e\u003e\u003e bitstream_uuid\u003d\u00277e817df0-5e64-48c8-bf14-ab4d7f07c258\u0027\n\u003e\u003e\u003e download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\", prefix\u003dbitstream_uuid)\n\u003e\u003e\u003e download_path.name\n\u0027/tmp/7e817df0-5e64-48c8-bf14-ab4d7f07c258z9lee_ny.gbs\u0027\n\u003e\u003e\u003e os.path.exists(\u0027/tmp/7e817df0-5e64-48c8-bf14-ab4d7f07c258z9lee_ny.gbs\u0027)\nTrue\n# checked that in my env, file  \u0027/tmp/7e817df0-5e64-48c8-bf14-ab4d7f07c258z9lee_ny.gbs\u0027 was indeed created\n\u003e\u003e\u003e os.remove(download_path.name)\n# after remove operation, file \u0027/tmp/7e817df0-5e64-48c8-bf14-ab4d7f07c258z9lee_ny.gbs\u0027 no longer exist","commit_id":"38b990e5fc8a248c45f391671edf696508573260"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"d6c2a04254f98fbb30b99cdcbad2c2879728c82c","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":53,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":54,"context_line":"        download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":55,"context_line":"                                                    prefix\u003dbitstream_uuid)"},{"line_number":56,"context_line":"        self.image_api.download(context,"},{"line_number":57,"context_line":"                                bitstream_uuid,"},{"line_number":58,"context_line":"                                dest_path\u003ddownload_path.name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_2927f6b5","line":55,"range":{"start_line":55,"start_character":59,"end_line":55,"end_character":73},"updated":"2020-04-23 01:03:39.000000000","message":"I think we should use str() to change it\u0027s type, otherwise there will be an error, as below:\n\n\u003e\u003e\u003e bitstream_uuid\u003duuid.uuid1()\n\u003e\u003e\u003e bitstream_uuid\nUUID(\u0027d0a68036-84fc-11ea-b339-fa163ec74400\u0027)\n\u003e\u003e\u003e download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\",prefix\u003dbitstream_uuid)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"/usr/lib/python3.6/tempfile.py\", line 690, in NamedTemporaryFile\n    (fd, name) \u003d _mkstemp_inner(dir, prefix, suffix, flags, output_type)\n  File \"/usr/lib/python3.6/tempfile.py\", line 399, in _mkstemp_inner\n    file \u003d _os.path.join(dir, pre + name + suf)\nTypeError: unsupported operand type(s) for +: \u0027UUID\u0027 and \u0027str\u0027\n\n\u003e\u003e\u003e download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\", prefix\u003dstr(bitstream_uuid))\n\u003e\u003e\u003e download_path.__dict__\n{\u0027file\u0027: \u003c_io.BufferedRandom name\u003d3\u003e, \u0027name\u0027: \u0027/tmp/d0a68036-84fc-11ea-b339-fa163ec744008358ihy0.gbs\u0027, \u0027delete\u0027: True, \u0027_closer\u0027: \u003ctempfile._TemporaryFileCloser object at 0x7f1229df7780\u003e}","commit_id":"6d08e9cf7998ac2e2634cad8166ba85648ad3878"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bb189846efe576142eba591ae0c1b3de15a2bade","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":53,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":54,"context_line":"        download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":55,"context_line":"                                                    prefix\u003dbitstream_uuid)"},{"line_number":56,"context_line":"        self.image_api.download(context,"},{"line_number":57,"context_line":"                                bitstream_uuid,"},{"line_number":58,"context_line":"                                dest_path\u003ddownload_path.name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_a41e8db7","line":55,"range":{"start_line":55,"start_character":59,"end_line":55,"end_character":73},"in_reply_to":"1f493fa4_24055d78","updated":"2020-04-23 02:39:36.000000000","message":"It\u0027s ok, please add UT to test, as PS3 do in python3 env.","commit_id":"6d08e9cf7998ac2e2634cad8166ba85648ad3878"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"ab66d7265ff35f6c904631d944709567b68d81f6","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":53,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":54,"context_line":"        download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":55,"context_line":"                                                    prefix\u003dbitstream_uuid)"},{"line_number":56,"context_line":"        self.image_api.download(context,"},{"line_number":57,"context_line":"                                bitstream_uuid,"},{"line_number":58,"context_line":"                                dest_path\u003ddownload_path.name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_699f3e50","line":55,"range":{"start_line":55,"start_character":59,"end_line":55,"end_character":73},"in_reply_to":"1f493fa4_2927f6b5","updated":"2020-04-23 01:13:55.000000000","message":"Hi brin. This method\u0027s param uuid is called like:https://github.com/openstack/cyborg/blob/19ffa3b790e1b40a93031b9ef085e2e8908963ed/cyborg/objects/extarq/fpga_ext_arq.py#L43\n\nThis situation uuid.uuid1() I think user will not occour.","commit_id":"6d08e9cf7998ac2e2634cad8166ba85648ad3878"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"3c30b405c2564431f81caed775ca86b6d2ecf709","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":53,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":54,"context_line":"        download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":55,"context_line":"                                                    prefix\u003dbitstream_uuid)"},{"line_number":56,"context_line":"        self.image_api.download(context,"},{"line_number":57,"context_line":"                                bitstream_uuid,"},{"line_number":58,"context_line":"                                dest_path\u003ddownload_path.name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_24055d78","line":55,"range":{"start_line":55,"start_character":59,"end_line":55,"end_character":73},"in_reply_to":"1f493fa4_44286933","updated":"2020-04-23 02:28:11.000000000","message":"@brin. I guess You had miss some information about the param bitstream_uuid, When we call this fpga_program_v2 method, the bitstream_uuid had ensure be str format.","commit_id":"6d08e9cf7998ac2e2634cad8166ba85648ad3878"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"caf71be3c0f229ca11cc65c4544fc17067ba0bdc","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":53,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":54,"context_line":"        download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":55,"context_line":"                                                    prefix\u003dbitstream_uuid)"},{"line_number":56,"context_line":"        self.image_api.download(context,"},{"line_number":57,"context_line":"                                bitstream_uuid,"},{"line_number":58,"context_line":"                                dest_path\u003ddownload_path.name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_e9998e1f","line":55,"range":{"start_line":55,"start_character":59,"end_line":55,"end_character":73},"in_reply_to":"1f493fa4_699f3e50","updated":"2020-04-23 01:28:57.000000000","message":"\u003e Hi brin. This method\u0027s param uuid is called like:https://github.com/openstack/cyborg/blob/19ffa3b790e1b40a93031b9ef085e2e8908963ed/cyborg/objects/extarq/fpga_ext_arq.py#L43\n \u003e \n \u003e This situation uuid.uuid1() I think user will not occour.\n\nWhat do you mean? I think whether uuid.uuid1() or uuid.uuid4(), the \u0027prefix\u0027\u0027s type should a str, if we change it that can avoid the situation list by me above.","commit_id":"6d08e9cf7998ac2e2634cad8166ba85648ad3878"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"56c241f497c1ebafc7d51968a5f8c2d6e5eb388e","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":53,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":54,"context_line":"        download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":55,"context_line":"                                                    prefix\u003dbitstream_uuid)"},{"line_number":56,"context_line":"        self.image_api.download(context,"},{"line_number":57,"context_line":"                                bitstream_uuid,"},{"line_number":58,"context_line":"                                dest_path\u003ddownload_path.name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_44286933","line":55,"range":{"start_line":55,"start_character":59,"end_line":55,"end_character":73},"in_reply_to":"1f493fa4_84aef1e4","updated":"2020-04-23 02:11:58.000000000","message":"If we have use case to cover this scenario, I think you can understand why this can be failed.\n\n1. \u003e\u003e\u003e bitstream_uuid\u003duuid.uuid1()\n\n2.\u003e\u003e\u003e uuid.uuid1()\nUUID(\u0027d0a68036-84fc-11ea-b339-fa163ec74400\u0027)\n\u003e\u003e\u003e bitstream_uuid\u003d\u0027d0a68036-84fc-11ea-b339-fa163ec74400\u0027\n\nStep 2 has one more assignment operation than Step 1. Yumeng\u0027s response to Shogo in PS3 is correct, but if you do a unit testing, I think you would like to use step 1, rirht? I don\u0027t know if my persistence is correct. If you think there is no problem here, I can remove my vote.\n\n\n@Yumeng, can you add test case to cover this changes?","commit_id":"6d08e9cf7998ac2e2634cad8166ba85648ad3878"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"a7c6a0b007bf9eaa52beab20766cf52a28a93d80","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":53,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":54,"context_line":"        download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":55,"context_line":"                                                    prefix\u003dbitstream_uuid)"},{"line_number":56,"context_line":"        self.image_api.download(context,"},{"line_number":57,"context_line":"                                bitstream_uuid,"},{"line_number":58,"context_line":"                                dest_path\u003ddownload_path.name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_c42e39a4","line":55,"range":{"start_line":55,"start_character":59,"end_line":55,"end_character":73},"in_reply_to":"1f493fa4_a41e8db7","updated":"2020-04-23 03:05:12.000000000","message":"Hi Brin, IMHO, there is no unit test affected.\nThis change won\u0027t affect the main feature, and it doesn\u0027t add any new feature, it just replaced the existed path maker with the standard and safe temp-file-making module.","commit_id":"6d08e9cf7998ac2e2634cad8166ba85648ad3878"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"934f7390827392ce326bbe3fd59372e7ae8f83a9","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def fpga_program_v2(self, context, controlpath_id,"},{"line_number":53,"context_line":"                        bitstream_uuid, driver_name):"},{"line_number":54,"context_line":"        download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":55,"context_line":"                                                    prefix\u003dbitstream_uuid)"},{"line_number":56,"context_line":"        self.image_api.download(context,"},{"line_number":57,"context_line":"                                bitstream_uuid,"},{"line_number":58,"context_line":"                                dest_path\u003ddownload_path.name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_84aef1e4","line":55,"range":{"start_line":55,"start_character":59,"end_line":55,"end_character":73},"in_reply_to":"1f493fa4_e9998e1f","updated":"2020-04-23 01:49:18.000000000","message":"bitstream_uuid already str format.","commit_id":"6d08e9cf7998ac2e2634cad8166ba85648ad3878"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"844a1ab7313669b493801d3ae99af00228eb2f50","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        bitstream_uuid \u003d str(bitstream_uuid)"},{"line_number":57,"context_line":"        if not uuidutils.is_uuid_like(bitstream_uuid):"},{"line_number":58,"context_line":"            raise exception.InvalidUUID(uuid\u003dbitstream_uuid)"},{"line_number":59,"context_line":"        else:"},{"line_number":60,"context_line":"            download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":61,"context_line":"                                                        prefix\u003dbitstream_uuid)"},{"line_number":62,"context_line":"            self.image_api.download(context,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f493fa4_fcdca575","line":59,"range":{"start_line":59,"start_character":8,"end_line":59,"end_character":13},"updated":"2020-04-23 08:27:43.000000000","message":"You can remove else, this is not necessary.","commit_id":"66d89789f9105e0f336633cd4cf0c85789311a0a"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"2f8fa18f554df754c8f8319ed659ac7ba289b655","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        bitstream_uuid \u003d str(bitstream_uuid)"},{"line_number":57,"context_line":"        if not uuidutils.is_uuid_like(bitstream_uuid):"},{"line_number":58,"context_line":"            raise exception.InvalidUUID(uuid\u003dbitstream_uuid)"},{"line_number":59,"context_line":"        else:"},{"line_number":60,"context_line":"            download_path \u003d tempfile.NamedTemporaryFile(suffix\u003d\".gbs\","},{"line_number":61,"context_line":"                                                        prefix\u003dbitstream_uuid)"},{"line_number":62,"context_line":"            self.image_api.download(context,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f493fa4_fccb0550","line":59,"range":{"start_line":59,"start_character":8,"end_line":59,"end_character":13},"in_reply_to":"1f493fa4_fcdca575","updated":"2020-04-23 08:48:31.000000000","message":"Done","commit_id":"66d89789f9105e0f336633cd4cf0c85789311a0a"}]}
