summaryrefslogtreecommitdiffstats
path: root/kilo/kilo/requests/views/flavor.py
diff options
context:
space:
mode:
Diffstat (limited to 'kilo/kilo/requests/views/flavor.py')
-rw-r--r--kilo/kilo/requests/views/flavor.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/kilo/kilo/requests/views/flavor.py b/kilo/kilo/requests/views/flavor.py
index fb8fb697..84cbc419 100644
--- a/kilo/kilo/requests/views/flavor.py
+++ b/kilo/kilo/requests/views/flavor.py
@@ -14,7 +14,7 @@
import logging
import json
import traceback
-
+from keystoneauth1.exceptions import HttpError
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
@@ -118,6 +118,9 @@ class Flavors(APIView):
return Response(data=content, status=resp.status_code)
except VimDriverKiloException as e:
return Response(data={'error': e.content}, status=e.status_code)
+ except HttpError as e:
+ logger.error("HttpError: status:%s, response:%s" % (e.http_status, e.response.json()))
+ return Response(data=e.response.json(), status=e.http_status)
except Exception as e:
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},
@@ -241,6 +244,9 @@ class Flavors(APIView):
self.delete_flavor(sess, flavorid)
return Response(data={'error': e.content}, status=e.status_code)
+ except HttpError as e:
+ logger.error("HttpError: status:%s, response:%s" % (e.http_status, e.response.json()))
+ return Response(data=e.response.json(), status=e.http_status)
except Exception as e:
logger.error(traceback.format_exc())
@@ -309,6 +315,9 @@ class Flavors(APIView):
return Response(status=resp.status_code)
except VimDriverKiloException as e:
return Response(data={'error': e.content}, status=e.status_code)
+ except HttpError as e:
+ logger.error("HttpError: status:%s, response:%s" % (e.http_status, e.response.json()))
+ return Response(data=e.response.json(), status=e.http_status)
except Exception as e:
logger.error(traceback.format_exc())
return Response(data={'error': str(e)},