Pass *args to VM_CLASS.

Move Config the the base manager.
More checks for projects (UUID,  makedirs).
Return error 500 when a VMError exception is raised.
Some more progress to VirtualBox.
This commit is contained in:
Jeremy
2015-01-20 19:02:22 -07:00
parent 3530b85b56
commit 7a19c9062e
11 changed files with 95 additions and 82 deletions

View File

@ -147,7 +147,7 @@ class PortManager:
else:
continue
raise HTTPConflict(reason="Could not find a free port between {} and {} on host {}, last exception: {}".format(start_port,
raise HTTPConflict(text="Could not find a free port between {} and {} on host {}, last exception: {}".format(start_port,
end_port,
host,
last_exception))
@ -174,7 +174,7 @@ class PortManager:
"""
if port in self._used_tcp_ports:
raise HTTPConflict(reason="TCP port already {} in use on host".format(port, self._console_host))
raise HTTPConflict(text="TCP port already {} in use on host".format(port, self._console_host))
self._used_tcp_ports.add(port)
return port
@ -209,7 +209,7 @@ class PortManager:
"""
if port in self._used_udp_ports:
raise Exception("UDP port already {} in use on host".format(port, self._host))
raise HTTPConflict(text="UDP port already {} in use on host".format(port, self._console_host))
self._used_udp_ports.add(port)
def release_udp_port(self, port):