migration to python3 (#1)
Change-Id: I964b75c1316b7711cde905c6e98ea027a8557047
Signed-off-by: peusterm <manuel.peuster@uni-paderborn.de>
diff --git a/src/emuvim/api/rest/compute.py b/src/emuvim/api/rest/compute.py
index 62a8f18..baa1830 100755
--- a/src/emuvim/api/rest/compute.py
+++ b/src/emuvim/api/rest/compute.py
@@ -97,7 +97,9 @@
c.start()
except Exception as ex:
logging.warning("Couldn't run Docker entry point VIM_EMU_CMD")
- logging.exception("Exception:")
+ logging.exception(
+ "Exception: " + str(ex) + "; " + str(type(ex))
+ )
# return docker inspect dict
return c.getStatus(), 200, CORS_HEADER
except Exception as ex:
@@ -153,7 +155,7 @@
if dc_label is None or dc_label == 'None':
# return list with all compute nodes in all DCs
all_containers = []
- for dc in dcs.itervalues():
+ for dc in dcs.values():
all_containers += dc.listCompute()
container_list = [(c.name, c.getStatus())
for c in all_containers]
@@ -246,7 +248,7 @@
def get(self):
logging.debug("API CALL: datacenter list")
try:
- return [d.getStatus() for d in dcs.itervalues()], 200, CORS_HEADER
+ return [d.getStatus() for d in dcs.values()], 200, CORS_HEADER
except Exception as ex:
logging.exception("API error.")
return ex.message, 500, CORS_HEADER
diff --git a/src/emuvim/api/rest/network.py b/src/emuvim/api/rest/network.py
index e8c6b9a..a16a84a 100755
--- a/src/emuvim/api/rest/network.py
+++ b/src/emuvim/api/rest/network.py
@@ -115,7 +115,7 @@
return str(c), 200, CORS_HEADER
except Exception as ex:
logging.exception("API error.")
- return ex.message, 500, CORS_HEADER
+ return str(ex), 500, CORS_HEADER
class DrawD3jsgraph(Resource):
diff --git a/src/emuvim/api/rest/rest_api_endpoint.py b/src/emuvim/api/rest/rest_api_endpoint.py
index d2abde8..c5154cb 100755
--- a/src/emuvim/api/rest/rest_api_endpoint.py
+++ b/src/emuvim/api/rest/rest_api_endpoint.py
@@ -31,15 +31,15 @@
from gevent.pywsgi import WSGIServer
# need to import total module to set its global variable dcs
-import compute
-from compute import ComputeList, Compute, ComputeResources, DatacenterList, DatacenterStatus
+from emuvim.api.rest import compute
+from emuvim.api.rest.compute import ComputeList, Compute, ComputeResources, DatacenterList, DatacenterStatus
# need to import total module to set its global variable net
-import network
-from network import NetworkAction, DrawD3jsgraph
+from emuvim.api.rest import network
+from emuvim.api.rest.network import NetworkAction, DrawD3jsgraph
-import monitor
-from monitor import MonitorInterfaceAction, MonitorFlowAction, MonitorLinkAction, MonitorSkewAction, MonitorTerminal
+from emuvim.api.rest import monitor
+from emuvim.api.rest.monitor import MonitorInterfaceAction, MonitorFlowAction, MonitorLinkAction, MonitorSkewAction, MonitorTerminal
import pkg_resources
from os import path