mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-02-06 16:23:49 +02:00
Check for OSError when starting the server.
This commit is contained in:
parent
334835c985
commit
8d471a89a8
@ -79,7 +79,7 @@ def parse_arguments():
|
|||||||
parser.add_argument("--ssl", action="store_true", help="run in SSL mode")
|
parser.add_argument("--ssl", action="store_true", help="run in SSL mode")
|
||||||
parser.add_argument("--certfile", help="SSL cert file", default="")
|
parser.add_argument("--certfile", help="SSL cert file", default="")
|
||||||
parser.add_argument("--certkey", help="SSL key file", default="")
|
parser.add_argument("--certkey", help="SSL key file", default="")
|
||||||
parser.add_argument("-L", "--local", action="store_true", help="local mode (allow some insecure operations)")
|
parser.add_argument("-L", "--local", action="store_true", help="local mode (allows some insecure operations)")
|
||||||
parser.add_argument("-A", "--allow", action="store_true", help="allow remote connections to local console ports")
|
parser.add_argument("-A", "--allow", action="store_true", help="allow remote connections to local console ports")
|
||||||
parser.add_argument("-q", "--quiet", action="store_true", help="do not show logs on stdout")
|
parser.add_argument("-q", "--quiet", action="store_true", help="do not show logs on stdout")
|
||||||
parser.add_argument("-d", "--debug", action="store_true", help="show debug logs and enable code live reload")
|
parser.add_argument("-d", "--debug", action="store_true", help="show debug logs and enable code live reload")
|
||||||
|
@ -53,7 +53,12 @@ class Server:
|
|||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def _run_application(self, app, ssl_context=None):
|
def _run_application(self, app, ssl_context=None):
|
||||||
|
|
||||||
server = yield from self._loop.create_server(app.make_handler(), self._host, self._port, ssl=ssl_context)
|
try:
|
||||||
|
server = yield from self._loop.create_server(app.make_handler(), self._host, self._port, ssl=ssl_context)
|
||||||
|
except OSError as e:
|
||||||
|
log.critical("Could not start the server: {}".format(e))
|
||||||
|
self._loop.stop()
|
||||||
|
return
|
||||||
return server
|
return server
|
||||||
|
|
||||||
def _stop_application(self):
|
def _stop_application(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user