File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1490,10 +1490,13 @@ def init_webapp(self):
1490
1490
self .http_server .listen (port , self .ip )
1491
1491
except socket .error as e :
1492
1492
if e .errno == errno .EADDRINUSE :
1493
- self .log .info (_ ('The port %i is already in use, trying another port.' ) % port )
1493
+ if self .port_retries :
1494
+ self .log .info (_ ('The port %i is already in use, trying another port.' ) % port )
1495
+ else :
1496
+ self .log .info (_ ('The port %i is already in use.' ) % port )
1494
1497
continue
1495
1498
elif e .errno in (errno .EACCES , getattr (errno , 'WSAEACCES' , errno .EACCES )):
1496
- self .log .warning (_ ("Permission to listen on port %i denied" ) % port )
1499
+ self .log .warning (_ ("Permission to listen on port %i denied. " ) % port )
1497
1500
continue
1498
1501
else :
1499
1502
raise
@@ -1502,8 +1505,12 @@ def init_webapp(self):
1502
1505
success = True
1503
1506
break
1504
1507
if not success :
1505
- self .log .critical (_ ('ERROR: the notebook server could not be started because '
1508
+ if self .port_retries :
1509
+ self .log .critical (_ ('ERROR: the notebook server could not be started because '
1506
1510
'no available port could be found.' ))
1511
+ else :
1512
+ self .log .critical (_ ('ERROR: the notebook server could not be started because '
1513
+ 'port %i is not available.' ) % port )
1507
1514
self .exit (1 )
1508
1515
1509
1516
@property
You can’t perform that action at this time.
0 commit comments