From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: yocto@yoctoproject.org
Subject: [layerindex-web][PATCH 2/3] Fix output decoding/reporting for bulk change patch download
Date: Wed, 31 Aug 2016 09:03:30 +1200 [thread overview]
Message-ID: <3cc87cff7755d8efdbdab661cc08b75a20da400a.1472590929.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1472590929.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1472590929.git.paul.eggleton@linux.intel.com>
With Python 3 we need to take care of decoding the output so we can
treat it as a string. At the same time, it's more useful to see the
output string rather than the exception if there is some output.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
layerindex/views.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/layerindex/views.py b/layerindex/views.py
index dfe4453..62f5268 100644
--- a/layerindex/views.py
+++ b/layerindex/views.py
@@ -237,8 +237,11 @@ def bulk_change_patch_view(request, pk):
except Exception as e:
output = getattr(e, 'output', None)
if output:
+ output = output.decode('utf-8', errors="ignore")
if 'timeout' in output:
return HttpResponse('Failed to generate patches: timed out waiting for lock. Please try again shortly.', content_type='text/plain')
+ else:
+ return HttpResponse('Failed to generate patches: %s' % output, content_type='text/plain')
return HttpResponse('Failed to generate patches: %s' % e, content_type='text/plain')
# FIXME better error handling
--
2.5.5
next prev parent reply other threads:[~2016-08-30 21:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-30 21:03 [layerindex-web][PATCH 0/3] Layer index fixes Paul Eggleton
2016-08-30 21:03 ` [layerindex-web][PATCH 1/3] Use python3 commands in README Paul Eggleton
2016-08-30 21:03 ` Paul Eggleton [this message]
2016-08-30 21:03 ` [layerindex-web][PATCH 3/3] update_layer.py: fix up for bitbake API change Paul Eggleton
2016-08-30 21:32 ` [layerindex-web][PATCH 0/3] Layer index fixes Andreas Müller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3cc87cff7755d8efdbdab661cc08b75a20da400a.1472590929.git.paul.eggleton@linux.intel.com \
--to=paul.eggleton@linux.intel.com \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.