)]}'
{"trove/guestagent/volume.py":[{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"96b3ce457acad85fafba1c2cc6b8aa8dda37db84","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        with open(\u0027/etc/fstab\u0027, \"r\") as fstab:"},{"line_number":208,"context_line":"            fstab_content \u003d fstab.read()"},{"line_number":209,"context_line":"        with NamedTemporaryFile(delete\u003dFalse) as tempfstab:"},{"line_number":210,"context_line":"            if six.PY3:"},{"line_number":211,"context_line":"                tempfstab.write(bytes((fstab_content + fstab_line), \u0027utf8\u0027))"},{"line_number":212,"context_line":"            else:"},{"line_number":213,"context_line":"                tempfstab.write(fstab_content + fstab_line)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa6399be_37f7e4f6","line":210,"range":{"start_line":210,"start_character":19,"end_line":210,"end_character":22},"updated":"2016-10-17 21:41:58.000000000","message":"It probably really makes sense to test for PY2 and have the Python 3 implementation in the else block. The chances are that any future version of Python will be more similar to Python 3 than 2.","commit_id":"03f779d8e1f386c067bc2ecaa243c3622d6f266c"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"c8fa94225145351336e6f9dd07934b50e5e938c8","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            fstab_content \u003d fstab.read()"},{"line_number":209,"context_line":"        with NamedTemporaryFile(delete\u003dFalse) as tempfstab:"},{"line_number":210,"context_line":"            if six.PY3:"},{"line_number":211,"context_line":"                tempfstab.write(bytes((fstab_content + fstab_line), \u0027utf8\u0027))"},{"line_number":212,"context_line":"            else:"},{"line_number":213,"context_line":"                tempfstab.write(fstab_content + fstab_line)"},{"line_number":214,"context_line":"        utils.execute(\"sudo\", \"install\", \"-o\", \"root\", \"-g\", \"root\", \"-m\","}],"source_content_type":"text/x-python","patch_set":6,"id":"fa6399be_17402007","line":211,"range":{"start_line":211,"start_character":39,"end_line":211,"end_character":65},"updated":"2016-10-17 21:44:54.000000000","message":"You could also pull this into a variable outside the if block and replace the two usages with it.","commit_id":"03f779d8e1f386c067bc2ecaa243c3622d6f266c"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"c8fa94225145351336e6f9dd07934b50e5e938c8","unresolved":false,"context_lines":[{"line_number":210,"context_line":"            if six.PY3:"},{"line_number":211,"context_line":"                tempfstab.write(bytes((fstab_content + fstab_line), \u0027utf8\u0027))"},{"line_number":212,"context_line":"            else:"},{"line_number":213,"context_line":"                tempfstab.write(fstab_content + fstab_line)"},{"line_number":214,"context_line":"        utils.execute(\"sudo\", \"install\", \"-o\", \"root\", \"-g\", \"root\", \"-m\","},{"line_number":215,"context_line":"                      \"644\", tempfstab.name, \"/etc/fstab\")"},{"line_number":216,"context_line":"        os.remove(tempfstab.name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa6399be_975430cb","line":213,"range":{"start_line":213,"start_character":32,"end_line":213,"end_character":58},"updated":"2016-10-17 21:44:54.000000000","message":"see above","commit_id":"03f779d8e1f386c067bc2ecaa243c3622d6f266c"},{"author":{"_account_id":14576,"name":"Petr Malik","email":"pmalik@tesora.com","username":"pmalik"},"change_message_id":"86dfbad65f3813d8f32212404afa4b30c678589c","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        with open(\u0027/etc/fstab\u0027, \"r\") as fstab:"},{"line_number":208,"context_line":"            fstab_content \u003d fstab.read()"},{"line_number":209,"context_line":"        fstab_message \u003d fstab_content + fstab_line"},{"line_number":210,"context_line":"        with NamedTemporaryFile(delete\u003dFalse) as tempfstab:"},{"line_number":211,"context_line":"            if not six.PY2:"},{"line_number":212,"context_line":"                tempfstab.write(bytes((fstab_message), \u0027utf8\u0027))"},{"line_number":213,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa6399be_0c4c396f","line":210,"range":{"start_line":210,"start_character":13,"end_line":210,"end_character":45},"updated":"2016-10-19 17:25:27.000000000","message":"Just open the temp file in text mode: NamedTemporaryFile(mode\u003d\u0027w\u0027, delete\u003dFalse)","commit_id":"cb00a19d720e023714c02fcaf19aec103c56de0d"}]}
