summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/deployment-server-reference.qdoc7
-rw-r--r--store/api.py5
-rw-r--r--store/osandarch.py2
3 files changed, 11 insertions, 3 deletions
diff --git a/doc/src/deployment-server-reference.qdoc b/doc/src/deployment-server-reference.qdoc
index c49c3d2..b81bd7f 100644
--- a/doc/src/deployment-server-reference.qdoc
+++ b/doc/src/deployment-server-reference.qdoc
@@ -78,7 +78,7 @@
\li Value
\li Description
\row
- \li {1,5} status
+ \li {1,6} status
\li ok
\li Successful
\row
@@ -91,6 +91,9 @@
\li incompatible-version
\li The API version you are using is not compatible.
\row
+ \li incompatible-architecture
+ \li The architecture parameter was malformed, or server was unable to parse it.
+ \row
\li malformed-tag
\li The tag format is incorrect, may not be alphanumeric, or could
not be parsed.
@@ -444,4 +447,4 @@
seconds.
\endlist
-*/ \ No newline at end of file
+*/
diff --git a/store/api.py b/store/api.py
index de975dd..09b6550 100644
--- a/store/api.py
+++ b/store/api.py
@@ -65,7 +65,10 @@ def hello(request):
break
request.session[j] = str(versionmap)
if 'architecture' in getRequestDictionary(request):
- request.session['architecture'] = normalizeArch(getRequestDictionary(request)['architecture'])
+ arch = normalizeArch(getRequestDictionary(request)['architecture'])
+ if arch == "":
+ status = 'incompatible-architecture'
+ request.session['architecture'] = arch
else:
request.session['architecture'] = ''
return JsonResponse({'status': status})
diff --git a/store/osandarch.py b/store/osandarch.py
index 9a2db12..0dde800 100644
--- a/store/osandarch.py
+++ b/store/osandarch.py
@@ -138,6 +138,8 @@ def normalizeArch(inputArch):
"""
parts = inputArch.split('-')
+ if len(parts) <4:
+ return "" # Invalid format
#Drop anything non-numeric from word_size field
parts[2]=re.sub(r"\D", "", parts[2])
#Transform kernelType into binary format