Fix bug 1255: returning UNPROCESSABLE_ENTITY when quota exceeded 40/9840/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 8 Oct 2020 15:25:45 +0000 (15:25 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 16 Oct 2020 08:25:48 +0000 (08:25 +0000)
When quota exceeded for vnfds, nsds, ns_instances topics, NBI
should return UNPROCESSABLE_ENTITY instead of UNAUTHORIZED

Change-Id: I0a8f4dc1df844e1027ff8234f101b82baa0bcee8
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osm_nbi/base_topic.py

index 9572409..c67ec76 100644 (file)
@@ -147,7 +147,7 @@ class BaseTopic:
             if count >= quota:
                 name = proj["name"]
                 raise ValidationError("quota ({}={}) exceeded for project {} ({})".format(quota_name, quota, name, pid),
-                                      http_code=HTTPStatus.UNAUTHORIZED)
+                                      http_code=HTTPStatus.UNPROCESSABLE_ENTITY)
 
     def _validate_input_new(self, input, force=False):
         """