)]}'
{"ironic_python_agent/extensions/standby.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f0c074c709810237b9e3d36eec2886a08b8ebd87","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    def is_image_service(self, image_info):"},{"line_number":56,"context_line":"        if \u0027torrent\u0027 in image_info:"},{"line_number":57,"context_line":"            return True"},{"line_number":58,"context_line":"        return False"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def validate(self, image_info):"},{"line_number":61,"context_line":"        # TODO(rameshg87): Validate if it\u0027s a valid torrent data."}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_926846f7","line":58,"updated":"2015-03-30 13:54:46.000000000","message":"nit:\n\n return \u0027torrent\u0027 in image_info","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"bfff0d4b7dd671738a7a8b35468ece731e541e3b","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    def is_image_service(self, image_info):"},{"line_number":56,"context_line":"        if \u0027torrent\u0027 in image_info:"},{"line_number":57,"context_line":"            return True"},{"line_number":58,"context_line":"        return False"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def validate(self, image_info):"},{"line_number":61,"context_line":"        # TODO(rameshg87): Validate if it\u0027s a valid torrent data."}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_4890af43","line":58,"in_reply_to":"da9b358b_926846f7","updated":"2015-03-31 04:30:08.000000000","message":"Done","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f0c074c709810237b9e3d36eec2886a08b8ebd87","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        # TODO(rameshg87): Validate if it\u0027s a valid torrent data."},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def download(self, image_info):"},{"line_number":65,"context_line":"        torrent_data \u003d base64.b64decode(image_info[\u0027torrent\u0027])"},{"line_number":66,"context_line":"        tc \u003d transmissionrpc.Client(\u0027localhost\u0027, port\u003d9091)"},{"line_number":67,"context_line":"        download_started_states \u003d [\u0027downloading\u0027, \u0027seed pending\u0027, \u0027seeding\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_328a9ac0","line":64,"updated":"2015-03-30 13:54:46.000000000","message":"please add some logging to this function (analogous to HttpImageService)","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"bfff0d4b7dd671738a7a8b35468ece731e541e3b","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        # TODO(rameshg87): Validate if it\u0027s a valid torrent data."},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def download(self, image_info):"},{"line_number":65,"context_line":"        torrent_data \u003d base64.b64decode(image_info[\u0027torrent\u0027])"},{"line_number":66,"context_line":"        tc \u003d transmissionrpc.Client(\u0027localhost\u0027, port\u003d9091)"},{"line_number":67,"context_line":"        download_started_states \u003d [\u0027downloading\u0027, \u0027seed pending\u0027, \u0027seeding\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_28932b51","line":64,"in_reply_to":"da9b358b_328a9ac0","updated":"2015-03-31 04:30:08.000000000","message":"Done","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f0c074c709810237b9e3d36eec2886a08b8ebd87","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            tmpfile.write(torrent_data)"},{"line_number":75,"context_line":"            tmpfile.flush()"},{"line_number":76,"context_line":"            retval \u003d tc.add_torrent(tmpfile, download_dir\u003ddownload_dir)"},{"line_number":77,"context_line":"            torrent_id \u003d retval.keys()[0]"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        starttime \u003d time.time()"},{"line_number":80,"context_line":"        currenttime \u003d starttime"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_d255ae1d","line":77,"updated":"2015-03-30 13:54:46.000000000","message":"nit: py3k-safe:\n\n torrent_id \u003d next(iter(retval))\n\nmaybe even handle StopIteration in case of empty response","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"bfff0d4b7dd671738a7a8b35468ece731e541e3b","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            tmpfile.write(torrent_data)"},{"line_number":75,"context_line":"            tmpfile.flush()"},{"line_number":76,"context_line":"            retval \u003d tc.add_torrent(tmpfile, download_dir\u003ddownload_dir)"},{"line_number":77,"context_line":"            torrent_id \u003d retval.keys()[0]"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        starttime \u003d time.time()"},{"line_number":80,"context_line":"        currenttime \u003d starttime"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_089aa763","line":77,"in_reply_to":"da9b358b_d255ae1d","updated":"2015-03-31 04:30:08.000000000","message":"Done","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f0c074c709810237b9e3d36eec2886a08b8ebd87","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        starttime \u003d time.time()"},{"line_number":80,"context_line":"        currenttime \u003d starttime"},{"line_number":81,"context_line":"        while (starttime + TORRENT_START_TIMEOUT_SECONDS) \u003e currenttime:"},{"line_number":82,"context_line":"            torrent \u003d tc.get_torrent(torrent_id)[torrent_id]"},{"line_number":83,"context_line":"            if torrent.status in download_started_states:"},{"line_number":84,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_d2036e0e","line":81,"updated":"2015-03-30 13:54:46.000000000","message":"currenttime is never updated, just use time.time()","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"bfff0d4b7dd671738a7a8b35468ece731e541e3b","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        starttime \u003d time.time()"},{"line_number":80,"context_line":"        currenttime \u003d starttime"},{"line_number":81,"context_line":"        while (starttime + TORRENT_START_TIMEOUT_SECONDS) \u003e currenttime:"},{"line_number":82,"context_line":"            torrent \u003d tc.get_torrent(torrent_id)[torrent_id]"},{"line_number":83,"context_line":"            if torrent.status in download_started_states:"},{"line_number":84,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_e89c235f","line":81,"in_reply_to":"da9b358b_d2036e0e","updated":"2015-03-31 04:30:08.000000000","message":"Done","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f0c074c709810237b9e3d36eec2886a08b8ebd87","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        # TODO(rameshg87): Put a timeout for download because it will keep"},{"line_number":91,"context_line":"        # on waiting for seeders."},{"line_number":92,"context_line":"        while(True):"},{"line_number":93,"context_line":"            torrent \u003d tc.get_torrent(torrent_id)[torrent_id]"},{"line_number":94,"context_line":"            current_status \u003d torrent.status"},{"line_number":95,"context_line":"            if current_status in completed_states:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_3203ba44","line":92,"updated":"2015-03-30 13:54:46.000000000","message":"nit: redundant brackets","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"bfff0d4b7dd671738a7a8b35468ece731e541e3b","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        # TODO(rameshg87): Put a timeout for download because it will keep"},{"line_number":91,"context_line":"        # on waiting for seeders."},{"line_number":92,"context_line":"        while(True):"},{"line_number":93,"context_line":"            torrent \u003d tc.get_torrent(torrent_id)[torrent_id]"},{"line_number":94,"context_line":"            current_status \u003d torrent.status"},{"line_number":95,"context_line":"            if current_status in completed_states:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_a89f3b4f","line":92,"in_reply_to":"da9b358b_3203ba44","updated":"2015-03-31 04:30:08.000000000","message":"Done","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f0c074c709810237b9e3d36eec2886a08b8ebd87","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        files_downloaded \u003d glob.glob(os.path.join(download_dir, \"*\"))"},{"line_number":104,"context_line":"        if len(files_downloaded) \u003e 1:"},{"line_number":105,"context_line":"            msg \u003d \"Invalid image torrent. Got more than one file\""},{"line_number":106,"context_line":"            raise errors.ImageDownloadError(image_info[\u0027id\u0027], msg)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        os.link(files_downloaded[0], image_location)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_260edb34","line":105,"updated":"2015-03-30 13:54:46.000000000","message":"nit: file listing might be helpful","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"bfff0d4b7dd671738a7a8b35468ece731e541e3b","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        files_downloaded \u003d glob.glob(os.path.join(download_dir, \"*\"))"},{"line_number":104,"context_line":"        if len(files_downloaded) \u003e 1:"},{"line_number":105,"context_line":"            msg \u003d \"Invalid image torrent. Got more than one file\""},{"line_number":106,"context_line":"            raise errors.ImageDownloadError(image_info[\u0027id\u0027], msg)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        os.link(files_downloaded[0], image_location)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_68a9337b","line":105,"in_reply_to":"da9b358b_260edb34","updated":"2015-03-31 04:30:08.000000000","message":"Done","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"ca75cd11c596403043d504061d7fdf98de3db20d","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        files_downloaded \u003d glob.glob(os.path.join(download_dir, \"*\"))"},{"line_number":104,"context_line":"        if len(files_downloaded) \u003e 1:"},{"line_number":105,"context_line":"            msg \u003d \"Invalid image torrent. Got more than one file\""},{"line_number":106,"context_line":"            raise errors.ImageDownloadError(image_info[\u0027id\u0027], msg)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        os.link(files_downloaded[0], image_location)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa53dc9_0fbf5afc","line":105,"in_reply_to":"da9b358b_68a9337b","updated":"2015-04-07 16:02:06.000000000","message":"Torrent files also contain a file list; you could check the listing before doing the download.","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f0c074c709810237b9e3d36eec2886a08b8ebd87","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def is_image_service(self, image_info):"},{"line_number":114,"context_line":"        if \u0027urls\u0027 in image_info:"},{"line_number":115,"context_line":"            return True"},{"line_number":116,"context_line":"        return False"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def validate(self, image_info):"},{"line_number":119,"context_line":"        if type(image_info[\u0027urls\u0027]) !\u003d list or not image_info[\u0027urls\u0027]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_128796b6","line":116,"updated":"2015-03-30 13:54:46.000000000","message":"nit:\n\n return \u0027urls\u0027 in image_info","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"bfff0d4b7dd671738a7a8b35468ece731e541e3b","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def is_image_service(self, image_info):"},{"line_number":114,"context_line":"        if \u0027urls\u0027 in image_info:"},{"line_number":115,"context_line":"            return True"},{"line_number":116,"context_line":"        return False"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def validate(self, image_info):"},{"line_number":119,"context_line":"        if type(image_info[\u0027urls\u0027]) !\u003d list or not image_info[\u0027urls\u0027]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_48b78fd8","line":116,"in_reply_to":"da9b358b_128796b6","updated":"2015-03-31 04:30:08.000000000","message":"Done","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f0c074c709810237b9e3d36eec2886a08b8ebd87","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        return False"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def validate(self, image_info):"},{"line_number":119,"context_line":"        if type(image_info[\u0027urls\u0027]) !\u003d list or not image_info[\u0027urls\u0027]:"},{"line_number":120,"context_line":"            raise errors.InvalidCommandParamsError("},{"line_number":121,"context_line":"                \u0027Image \\\u0027urls\\\u0027 must be a list with at least one element.\u0027)"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_b2bc6a6d","line":119,"updated":"2015-03-30 13:54:46.000000000","message":"nit:\n\n if not isinstance(image_info[\u0027urls\u0027], list) or not image_info[\u0027urls\u0027]:","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"bfff0d4b7dd671738a7a8b35468ece731e541e3b","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        return False"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def validate(self, image_info):"},{"line_number":119,"context_line":"        if type(image_info[\u0027urls\u0027]) !\u003d list or not image_info[\u0027urls\u0027]:"},{"line_number":120,"context_line":"            raise errors.InvalidCommandParamsError("},{"line_number":121,"context_line":"                \u0027Image \\\u0027urls\\\u0027 must be a list with at least one element.\u0027)"},{"line_number":122,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_08b187e1","line":119,"in_reply_to":"da9b358b_b2bc6a6d","updated":"2015-03-31 04:30:08.000000000","message":"Done","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f0c074c709810237b9e3d36eec2886a08b8ebd87","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                log_msg \u003d (\u0027Image download failed. URL: {0}; \u0027"},{"line_number":133,"context_line":"                           \u0027time: {1} seconds. Error: {2}\u0027)"},{"line_number":134,"context_line":"                LOG.warning(log_msg.format(url, failtime, e.details))"},{"line_number":135,"context_line":"                continue"},{"line_number":136,"context_line":"            else:"},{"line_number":137,"context_line":"                break"},{"line_number":138,"context_line":"        if resp is None:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_52bbde72","line":135,"updated":"2015-03-30 13:54:46.000000000","message":"nit: redundant continue","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"bfff0d4b7dd671738a7a8b35468ece731e541e3b","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                log_msg \u003d (\u0027Image download failed. URL: {0}; \u0027"},{"line_number":133,"context_line":"                           \u0027time: {1} seconds. Error: {2}\u0027)"},{"line_number":134,"context_line":"                LOG.warning(log_msg.format(url, failtime, e.details))"},{"line_number":135,"context_line":"                continue"},{"line_number":136,"context_line":"            else:"},{"line_number":137,"context_line":"                break"},{"line_number":138,"context_line":"        if resp is None:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_e8b303e8","line":135,"in_reply_to":"da9b358b_52bbde72","updated":"2015-03-31 04:30:08.000000000","message":"Done","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"f0c074c709810237b9e3d36eec2886a08b8ebd87","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                    f.write(chunk)"},{"line_number":147,"context_line":"            except Exception as e:"},{"line_number":148,"context_line":"                msg \u003d \u0027Unable to write image to {0}. Error: {1}\u0027.format("},{"line_number":149,"context_line":"                        image_location, str(e))"},{"line_number":150,"context_line":"                raise errors.ImageDownloadError(image_info[\u0027id\u0027], msg)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        totaltime \u003d time.time() - starttime"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_12ae762e","line":149,"updated":"2015-03-30 13:54:46.000000000","message":"nit: redundant str()","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"},{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"bfff0d4b7dd671738a7a8b35468ece731e541e3b","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                    f.write(chunk)"},{"line_number":147,"context_line":"            except Exception as e:"},{"line_number":148,"context_line":"                msg \u003d \u0027Unable to write image to {0}. Error: {1}\u0027.format("},{"line_number":149,"context_line":"                        image_location, str(e))"},{"line_number":150,"context_line":"                raise errors.ImageDownloadError(image_info[\u0027id\u0027], msg)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        totaltime \u003d time.time() - starttime"}],"source_content_type":"text/x-python","patch_set":2,"id":"da9b358b_c8cb9f52","line":149,"in_reply_to":"da9b358b_12ae762e","updated":"2015-03-31 04:30:08.000000000","message":"Done","commit_id":"b40ba9cfb388f848cf87a032e91b0cb5b904bfa4"}]}
