aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/views.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-08-01 20:27:47 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-08-01 21:00:39 +1200
commit3cc87cff7755d8efdbdab661cc08b75a20da400a (patch)
tree8b0cfbd16c6d9a1400134504342e47113e68fd07 /layerindex/views.py
parent79d09a3f1b5b1d2fe1779a2b6b104eb30e5dbe80 (diff)
downloadopenembedded-core-contrib-3cc87cff7755d8efdbdab661cc08b75a20da400a.tar.gz
Fix output decoding/reporting for bulk change patch download
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>
Diffstat (limited to 'layerindex/views.py')
-rw-r--r--layerindex/views.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/layerindex/views.py b/layerindex/views.py
index dfe445304e..62f5268405 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