)]}'
{"nova/tests/unit/virt/disk/vfs/fakeguestfs.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"74f5b63bfb70af70eb52cf267b846e169a64cd1c","unresolved":true,"context_lines":[{"line_number":109,"context_line":"                \"mode\": 0o700"},{"line_number":110,"context_line":"                }"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        return bytes(self.files[path][\"content\"].encode())"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def write(self, path, content):"},{"line_number":115,"context_line":"        if path not in self.files:"}],"source_content_type":"text/x-python","patch_set":1,"id":"0705d067_f94bcb46","line":112,"updated":"2021-04-23 11:46:19.000000000","message":"why we are returning bytes here? As far as I understasnd the original read_file() returns str not bytes. That is the fix here.","commit_id":"0e08ba718b969164faf0794b6ff18789f21f9d4c"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"e83cf325e1ca0851b8e5115375bfa65cf39c126a","unresolved":true,"context_lines":[{"line_number":109,"context_line":"                \"mode\": 0o700"},{"line_number":110,"context_line":"                }"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        return bytes(self.files[path][\"content\"].encode())"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def write(self, path, content):"},{"line_number":115,"context_line":"        if path not in self.files:"}],"source_content_type":"text/x-python","patch_set":1,"id":"17ad63a2_f73d4bc1","line":112,"in_reply_to":"0705d067_f94bcb46","updated":"2021-04-23 12:01:54.000000000","message":"Because that\u0027s the behaviour of the libguestfs python bindings after 1.41.1, this fake fixture is used to directly mock that module out via the guestfs global in the tests:\n\nhttps://github.com/openstack/nova/blob/3f2868ce3646b7e1a4ae5ca789819cfe9c0e48bc/nova/tests/unit/virt/disk/vfs/test_guestfs.py#L34-L36","commit_id":"0e08ba718b969164faf0794b6ff18789f21f9d4c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"4c0aac3982acafc0d155c8927a87cf628897107b","unresolved":true,"context_lines":[{"line_number":109,"context_line":"                \"mode\": 0o700"},{"line_number":110,"context_line":"                }"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        return bytes(self.files[path][\"content\"].encode())"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def write(self, path, content):"},{"line_number":115,"context_line":"        if path not in self.files:"}],"source_content_type":"text/x-python","patch_set":1,"id":"546e40fc_98774e0c","line":112,"in_reply_to":"17ad63a2_f73d4bc1","updated":"2021-04-23 12:06:08.000000000","message":"Ohh so the read_file here is not the replacement of the nova.virt.disk.vfs.guestfs.VFSGuestFS.read_file() function but a replacement of the read_file() function in the libguestfs.GuestFS.read_file() function. Sorry I was confused. Your change here is correct.","commit_id":"0e08ba718b969164faf0794b6ff18789f21f9d4c"}],"nova/virt/disk/api.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"74f5b63bfb70af70eb52cf267b846e169a64cd1c","unresolved":true,"context_lines":[{"line_number":615,"context_line":""},{"line_number":616,"context_line":"    :param username: the username"},{"line_number":617,"context_line":"    :param admin_passwd: the admin password"},{"line_number":618,"context_line":"    :param passwd_data: Data from the passwd file decoded as a string"},{"line_number":619,"context_line":"    :param shadow_data: Data from the shadow file decoded as a string"},{"line_number":620,"context_line":"    :returns: nothing"},{"line_number":621,"context_line":"    :raises: exception.NovaException(), IOError()"}],"source_content_type":"text/x-python","patch_set":1,"id":"71fc9b66_67068451","line":618,"updated":"2021-04-23 11:46:19.000000000","message":"mypy could also help here to express that we expect only string as incoming parameters","commit_id":"0e08ba718b969164faf0794b6ff18789f21f9d4c"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"e83cf325e1ca0851b8e5115375bfa65cf39c126a","unresolved":false,"context_lines":[{"line_number":615,"context_line":""},{"line_number":616,"context_line":"    :param username: the username"},{"line_number":617,"context_line":"    :param admin_passwd: the admin password"},{"line_number":618,"context_line":"    :param passwd_data: Data from the passwd file decoded as a string"},{"line_number":619,"context_line":"    :param shadow_data: Data from the shadow file decoded as a string"},{"line_number":620,"context_line":"    :returns: nothing"},{"line_number":621,"context_line":"    :raises: exception.NovaException(), IOError()"}],"source_content_type":"text/x-python","patch_set":1,"id":"f38d34cc_d3d359c8","line":618,"in_reply_to":"71fc9b66_67068451","updated":"2021-04-23 12:01:54.000000000","message":"Yeah I wanted to avoid that in this initial fix, I\u0027ll work on mypy changes in fups.","commit_id":"0e08ba718b969164faf0794b6ff18789f21f9d4c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"74f5b63bfb70af70eb52cf267b846e169a64cd1c","unresolved":true,"context_lines":[{"line_number":617,"context_line":"    :param admin_passwd: the admin password"},{"line_number":618,"context_line":"    :param passwd_data: Data from the passwd file decoded as a string"},{"line_number":619,"context_line":"    :param shadow_data: Data from the shadow file decoded as a string"},{"line_number":620,"context_line":"    :returns: nothing"},{"line_number":621,"context_line":"    :raises: exception.NovaException(), IOError()"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"1edc2bc0_5b714ade","line":620,"updated":"2021-04-23 11:46:19.000000000","message":"a bit unrelated but it is simply not true","commit_id":"0e08ba718b969164faf0794b6ff18789f21f9d4c"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"e83cf325e1ca0851b8e5115375bfa65cf39c126a","unresolved":false,"context_lines":[{"line_number":617,"context_line":"    :param admin_passwd: the admin password"},{"line_number":618,"context_line":"    :param passwd_data: Data from the passwd file decoded as a string"},{"line_number":619,"context_line":"    :param shadow_data: Data from the shadow file decoded as a string"},{"line_number":620,"context_line":"    :returns: nothing"},{"line_number":621,"context_line":"    :raises: exception.NovaException(), IOError()"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"65535499_6127a530","line":620,"in_reply_to":"1edc2bc0_5b714ade","updated":"2021-04-23 12:01:54.000000000","message":"Yeah I\u0027ll clean this up in a fup.","commit_id":"0e08ba718b969164faf0794b6ff18789f21f9d4c"}],"nova/virt/disk/vfs/guestfs.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"74f5b63bfb70af70eb52cf267b846e169a64cd1c","unresolved":true,"context_lines":[{"line_number":303,"context_line":"        path \u003d self._canonicalize_path(path)"},{"line_number":304,"context_line":"        self.handle.write(path, content)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    def read_file(self, path):"},{"line_number":307,"context_line":"        LOG.debug(\"Read file path\u003d%s\", path)"},{"line_number":308,"context_line":"        path \u003d self._canonicalize_path(path)"},{"line_number":309,"context_line":"        data \u003d self.handle.read_file(path)"}],"source_content_type":"text/x-python","patch_set":1,"id":"4e3c1f2d_e91c3803","line":306,"updated":"2021-04-23 11:46:19.000000000","message":"would be nice to add function doc or mypy annotation that expresses our intention to always return str from this function","commit_id":"0e08ba718b969164faf0794b6ff18789f21f9d4c"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"e83cf325e1ca0851b8e5115375bfa65cf39c126a","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        path \u003d self._canonicalize_path(path)"},{"line_number":304,"context_line":"        self.handle.write(path, content)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    def read_file(self, path):"},{"line_number":307,"context_line":"        LOG.debug(\"Read file path\u003d%s\", path)"},{"line_number":308,"context_line":"        path \u003d self._canonicalize_path(path)"},{"line_number":309,"context_line":"        data \u003d self.handle.read_file(path)"}],"source_content_type":"text/x-python","patch_set":1,"id":"95dbdaa4_fa292dce","line":306,"in_reply_to":"4e3c1f2d_e91c3803","updated":"2021-04-23 12:01:54.000000000","message":"ACK as elsewhere I\u0027ll do this in a follow up.","commit_id":"0e08ba718b969164faf0794b6ff18789f21f9d4c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"0efc0f2eba29f0706baba2abe08bdd92221210ff","unresolved":true,"context_lines":[{"line_number":311,"context_line":"        # return type of read_file from string to bytes and as such we need to"},{"line_number":312,"context_line":"        # handle both here, decoding and returning a string if bytes is"},{"line_number":313,"context_line":"        # provided. https://bugzilla.redhat.com/show_bug.cgi?id\u003d1661871"},{"line_number":314,"context_line":"        if type(data) is bytes:"},{"line_number":315,"context_line":"            return data.decode()"},{"line_number":316,"context_line":"        return data"},{"line_number":317,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"87194349_193b010e","line":314,"range":{"start_line":314,"start_character":8,"end_line":314,"end_character":31},"updated":"2021-04-23 12:56:32.000000000","message":"This would more typically be done as\n\n  isinstance(data, bytes)\n\nThere are some nuanced differences [1] but they\u0027re beneficial, if anything\n\n[1] https://stackoverflow.com/a/1549854/613428","commit_id":"0e08ba718b969164faf0794b6ff18789f21f9d4c"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"ce426fc4dbe375238372a07c3890e2d1870418e0","unresolved":false,"context_lines":[{"line_number":311,"context_line":"        # return type of read_file from string to bytes and as such we need to"},{"line_number":312,"context_line":"        # handle both here, decoding and returning a string if bytes is"},{"line_number":313,"context_line":"        # provided. https://bugzilla.redhat.com/show_bug.cgi?id\u003d1661871"},{"line_number":314,"context_line":"        if type(data) is bytes:"},{"line_number":315,"context_line":"            return data.decode()"},{"line_number":316,"context_line":"        return data"},{"line_number":317,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"101d4d4c_44ac23a1","line":314,"range":{"start_line":314,"start_character":8,"end_line":314,"end_character":31},"in_reply_to":"87194349_193b010e","updated":"2021-04-23 13:04:13.000000000","message":"Done","commit_id":"0e08ba718b969164faf0794b6ff18789f21f9d4c"}]}
