)]}'
{"os_brick/remotefs/remotefs.py":[{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"d33be2d604ba529f849555e9bbf4242cedece040","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        with open(\"/proc/mounts\", \"r\") as procmounts:"},{"line_number":86,"context_line":"            lines \u003d list(filter(lambda x: (len(x.split()) \u003e 2),"},{"line_number":87,"context_line":"                                list(procmounts)))"},{"line_number":88,"context_line":"            return dict(map(lambda x: reversed((x.split())[0:2]), lines))"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def mount(self, share, flags\u003dNone):"},{"line_number":91,"context_line":"        \"\"\"Mount given share.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa7e38b_38b43ff1","line":88,"updated":"2019-12-19 20:30:06.000000000","message":"This takes a bit more thinking to understand the code here than I would usually prefer... any chance of making it more straightforward?\n\nOr at least add a comment or two showing what\u0027s happening?","commit_id":"e9cd04c7be1398cad9873f26d768cf2752f90590"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"21625dd6a7b1bc4dbcc0fad3a44337f558b24d6f","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def _read_mounts(self):"},{"line_number":84,"context_line":"        \"\"\"Returns a dict of mounts and their mountpoint\"\"\""},{"line_number":85,"context_line":"        with open(\"/proc/mounts\", \"r\") as procmounts:"},{"line_number":86,"context_line":"            # Removing empty lines if any"},{"line_number":87,"context_line":"            lines \u003d list(filter(lambda x: (len(x.split()) \u003e 2),"},{"line_number":88,"context_line":"                                list(procmounts)))"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_afd540e8","line":85,"updated":"2019-12-20 11:23:18.000000000","message":"nit: Add a comment referencing the format of the file http://man7.org/linux/man-pages/man5/fstab.5.html","commit_id":"77ee36c94fb44156ce7e0e8ab70e750faf59af3b"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"21625dd6a7b1bc4dbcc0fad3a44337f558b24d6f","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        \"\"\"Returns a dict of mounts and their mountpoint\"\"\""},{"line_number":85,"context_line":"        with open(\"/proc/mounts\", \"r\") as procmounts:"},{"line_number":86,"context_line":"            # Removing empty lines if any"},{"line_number":87,"context_line":"            lines \u003d list(filter(lambda x: (len(x.split()) \u003e 2),"},{"line_number":88,"context_line":"                                list(procmounts)))"},{"line_number":89,"context_line":"            # Generates a dict using the first two arguments of"},{"line_number":90,"context_line":"            # each mount lines."},{"line_number":91,"context_line":"            # Dict Format:"},{"line_number":92,"context_line":"            # { \u0027mountpoint\u0027: \u0027mountdevice\u0027 }"},{"line_number":93,"context_line":"            return dict(map(lambda x: reversed((x.split())[0:2]), lines))"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def mount(self, share, flags\u003dNone):"},{"line_number":96,"context_line":"        \"\"\"Mount given share.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_6f5d087b","line":93,"range":{"start_line":87,"start_character":0,"end_line":93,"end_character":73},"updated":"2019-12-20 11:23:18.000000000","message":"-1: This code is not very readable, and is not taking into account comments.\n\nI think it\u0027s easier to read, and also removes comments, if we do something like:\n\n    with open(\"/proc/mounts\", \"r\") as mounts:\n        # Remove empty lines and split lines by whitespace\n        lines \u003d [l.split() for l in mounts.read().splitlines() if l.strip()]\n\n        # Return {mountpoint: mountdevice}.  Fields 2nd and 1st as per\n        # http://man7.org/linux/man-pages/man5/fstab.5.html\n        return {line[1]: line[0] for line in lines if line[0] !\u003d \u0027#\u0027}","commit_id":"77ee36c94fb44156ce7e0e8ab70e750faf59af3b"}]}
