summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--multivimbroker/multivimbroker/forwarder/views.py3
-rw-r--r--multivimbroker/multivimbroker/pub/utils/syscomm.py26
2 files changed, 15 insertions, 14 deletions
diff --git a/multivimbroker/multivimbroker/forwarder/views.py b/multivimbroker/multivimbroker/forwarder/views.py
index 7b9000c..5c7cd0a 100644
--- a/multivimbroker/multivimbroker/forwarder/views.py
+++ b/multivimbroker/multivimbroker/forwarder/views.py
@@ -269,7 +269,8 @@ class APIv1InfraWorkload(BaseServer):
def post(self, request, cloud_owner, cloud_region_id):
vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id)
- if len(request.FILES) != 0:
+ content_type = request.META.get('CONTENT_TYPE', 'application/json')
+ if content_type.startswith("multipart"):
return self.__process_multipart(request, vimid)
return self.send(vimid, request.get_full_path(), request.body, "POST",
headers=originHeaders(request))
diff --git a/multivimbroker/multivimbroker/pub/utils/syscomm.py b/multivimbroker/multivimbroker/pub/utils/syscomm.py
index 9e96d2e..7516d4b 100644
--- a/multivimbroker/multivimbroker/pub/utils/syscomm.py
+++ b/multivimbroker/multivimbroker/pub/utils/syscomm.py
@@ -68,16 +68,16 @@ def getMultivimDriver(vimid, full_path=""):
def getVIMTypes():
- # Fix here unless we have plugin registry
- json_file = os.path.join(os.path.dirname(__file__),
- '../config/provider-plugin.json')
- with open(json_file, "r") as f:
- plugins = json.load(f)
- ret = []
- for k, v in plugins.items():
- item = {}
- item["vim_type"] = v.get("vim_type")
- item["versions"] = [k for k in v.get('versions', {})]
- ret.append(item)
-
- return ret
+ # Fix here unless we have plugin registry
+ json_file = os.path.join(os.path.dirname(__file__),
+ '../config/provider-plugin.json')
+ with open(json_file, "r") as f:
+ plugins = json.load(f)
+ ret = []
+ for k, v in plugins.items():
+ item = {}
+ item["vim_type"] = v.get("vim_type")
+ item["versions"] = [k for k in v.get('versions', {})]
+ ret.append(item)
+
+ return ret