)]}'
{"nova/virt/disk/vfs/localfs.py":[{"author":{"_account_id":1812,"name":"p-draigbrady","email":"P@draigBrady.com","username":"p-draigbrady"},"change_message_id":"22df58c5d5a867f4dd91303d5c58589df1d20bbe","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        LOG.debug(_(\"Read file path\u003d%(path)s\") % locals())"},{"line_number":123,"context_line":"        canonpath \u003d self._canonical_path(path)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        f \u003d open(canonpath)"},{"line_number":126,"context_line":"        lines \u003d []"},{"line_number":127,"context_line":"        for line in f:"},{"line_number":128,"context_line":"            lines.append(line)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAMH%2F%2F7QU%3D","line":125,"updated":"2012-11-15 16:29:06.000000000","message":"So this assumes the path is readable by nova.\nMaybe fall back to something like:\n\ntry:\n    open()\nexcept OSError as e:\n    if e.errno \u003d errno.EPERM:\n        execute(\u0027cat\u0027,..., run_as_root\u003dTrue)","commit_id":"f58d5f430a1619ba3b9c75f2338b4948dcb5b9c3"},{"author":{"_account_id":1812,"name":"p-draigbrady","email":"P@draigBrady.com","username":"p-draigbrady"},"change_message_id":"c241c18884a7611b14640a00e696820992e12459","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        LOG.debug(_(\"Read file path\u003d%(path)s\") % locals())"},{"line_number":123,"context_line":"        canonpath \u003d self._canonical_path(path)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        f \u003d open(canonpath)"},{"line_number":126,"context_line":"        lines \u003d []"},{"line_number":127,"context_line":"        for line in f:"},{"line_number":128,"context_line":"            lines.append(line)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAMH%2F%2F7Go%3D","line":125,"in_reply_to":"AAAAMH%2F%2F7L8%3D","updated":"2012-11-15 17:59:56.000000000","message":"+1 In fact there is an existing function you could just call\n\n    utils.read_file_as_root(...)","commit_id":"f58d5f430a1619ba3b9c75f2338b4948dcb5b9c3"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"cfabdfb3e4e4941eb7509e3448aba72aa63c9138","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        LOG.debug(_(\"Read file path\u003d%(path)s\") % locals())"},{"line_number":123,"context_line":"        canonpath \u003d self._canonical_path(path)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        f \u003d open(canonpath)"},{"line_number":126,"context_line":"        lines \u003d []"},{"line_number":127,"context_line":"        for line in f:"},{"line_number":128,"context_line":"            lines.append(line)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAMH%2F%2F7L8%3D","line":125,"in_reply_to":"AAAAMH%2F%2F7QU%3D","updated":"2012-11-15 17:14:28.000000000","message":"This was just copied from the existing code. I\u0027m inclined to say we should just unconditionally use execute+cat, for consistency with the other APIs.","commit_id":"f58d5f430a1619ba3b9c75f2338b4948dcb5b9c3"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"bcf953a87827f7b2d568b1a652eebd49634bcebf","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    def has_file(self, path):"},{"line_number":134,"context_line":"        LOG.debug(_(\"Has file path\u003d%(path)s\") % locals())"},{"line_number":135,"context_line":"        canonpath \u003d self._canonical_path(path)"},{"line_number":136,"context_line":"        exists, _err \u003d utils.trycmd(\u0027readlink\u0027, \u0027-e\u0027,"},{"line_number":137,"context_line":"                                    canonpath,"},{"line_number":138,"context_line":"                                    run_as_root\u003dTrue)"},{"line_number":139,"context_line":"        return exists"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAMH%2F%2F1bI%3D","line":136,"updated":"2012-11-20 20:18:14.000000000","message":"given that we are running as root, is there any concern that this is running readlink without an absolute path?","commit_id":"f58d5f430a1619ba3b9c75f2338b4948dcb5b9c3"}]}
