Fix some issues
[multicloud/framework.git] / multivimbroker / multivimbroker / pub / msapi / extsys.py
index ac2fa13..1baa08a 100644 (file)
@@ -23,7 +23,7 @@ def get_vims():
     ret = req_by_msb(ESR_GET_VIM_URI, "GET")
     if ret[0] != 0:
         logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
-        raise VimBrokerException("Failed to query VIMs from extsys.")
+        raise VimBrokerException(status_code=404 ,content="Failed to query VIMs from extsys.")
     return json.JSONDecoder().decode(ret[1])
 
 
@@ -31,6 +31,6 @@ def get_vim_by_id(vim_id):
     ret = req_by_msb("%s/%s" % (ESR_GET_VIM_URI, vim_id), "GET")
     if ret[0] != 0:
         logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
-        raise VimBrokerException(
+        raise VimBrokerException(status_code=404,content=
             "Failed to query VIM with id (%s) from extsys." % vim_id)
     return json.JSONDecoder().decode(ret[1])