SEBA-282 return 401 on permission error
Change-Id: Ica0c1d6b2aae5a8ed13123f2e5c0382e418b5433
diff --git a/src/tosca/generator.py b/src/tosca/generator.py
index 3f54a77..0e36952 100644
--- a/src/tosca/generator.py
+++ b/src/tosca/generator.py
@@ -23,7 +23,7 @@
from xosapi.xos_grpc_client import Empty
class Args:
- pass
+ verbosity = 0
current_dir = os.path.dirname(os.path.realpath(__file__))
diff --git a/src/web_server/main.py b/src/web_server/main.py
index 3e2cf8f..9a6c9b3 100644
--- a/src/web_server/main.py
+++ b/src/web_server/main.py
@@ -51,6 +51,8 @@
request.setResponseCode(500)
try:
f = failure.getErrorMessage()
+ if f.startswith("XOSPermissionDenied"):
+ request.setResponseCode(401)
log.info("[XOS-TOSCA] Error while loading TOSCA: \n\n", failure=f)
return f
except Exception: