@@ -376,32 +376,36 @@ def getAdministrationPort(server, topology):
376
376
return port
377
377
378
378
379
- def isAdministrationPortEnabledForServer (server , topology ):
379
+ def isAdministrationPortEnabledForServer (server , model ):
380
380
administrationPortEnabled = False
381
381
if 'AdministrationPortEnabled' in server :
382
382
administrationPortEnabled = server ['AdministrationPortEnabled' ]
383
383
else :
384
- administrationPortEnabled = isAdministrationPortEnabledForDomain (topology )
384
+ administrationPortEnabled = isAdministrationPortEnabledForDomain (model )
385
385
return administrationPortEnabled
386
386
387
387
388
- def isAdministrationPortEnabledForDomain (topology ):
388
+ def isAdministrationPortEnabledForDomain (model ):
389
389
administrationPortEnabled = False
390
-
390
+ topology = model [ 'topology' ]
391
391
if 'AdministrationPortEnabled' in topology :
392
392
administrationPortEnabled = topology ['AdministrationPortEnabled' ]
393
393
else :
394
394
# AdministrationPortEnabled is not explicitly set so going with the default
395
395
# Starting with 14.1.2.0, the domain's AdministrationPortEnabled default is derived from the domain's SecureMode
396
- administrationPortEnabled = isSecureModeEnabledForDomain (topology )
396
+ administrationPortEnabled = isSecureModeEnabledForDomain (model )
397
397
return administrationPortEnabled
398
398
399
399
400
400
# Derive the default value for SecureMode of a domain
401
- def isSecureModeEnabledForDomain (topology ):
401
+ def isSecureModeEnabledForDomain (model ):
402
402
secureModeEnabled = False
403
+ topology = model ['topology' ]
404
+ domain_info = model ['domainInfo' ]
403
405
if 'SecurityConfiguration' in topology and 'SecureMode' in topology ['SecurityConfiguration' ] and 'SecureModeEnabled' in topology ['SecurityConfiguration' ]['SecureMode' ]:
404
406
secureModeEnabled = topology ['SecurityConfiguration' ]['SecureMode' ]['SecureModeEnabled' ]
407
+ elif 'ServerStartMode' in domain_info and domain_info ['ServerStartMode' ] == 'secure' :
408
+ secureModeEnabled = True
405
409
else :
406
410
is_production_mode_enabled = False
407
411
if 'ProductionModeEnabled' in topology :
@@ -449,7 +453,7 @@ def _get_ssl_listen_port(server):
449
453
ssl_listen_port = ssl ['ListenPort' ]
450
454
if ssl_listen_port is None :
451
455
ssl_listen_port = "7002"
452
- elif ssl is None and isSecureModeEnabledForDomain (model [ 'topology' ] ):
456
+ elif ssl is None and isSecureModeEnabledForDomain (model ):
453
457
ssl_listen_port = "7002"
454
458
return ssl_listen_port
455
459
@@ -480,8 +484,7 @@ def addAdminChannelPortForwardNetworkAccessPoints(server):
480
484
customAdminChannelPort = nap ['ListenPort' ]
481
485
_writeAdminChannelPortForwardNAP (name = 'internal-admin' + str (index ), server = server ,
482
486
listen_port = customAdminChannelPort , protocol = 'admin' )
483
-
484
- if isAdministrationPortEnabledForServer (server , model ['topology' ]):
487
+ if isAdministrationPortEnabledForServer (server , model ):
485
488
_writeAdminChannelPortForwardNAP (name = 'internal-admin' , server = server ,
486
489
listen_port = getAdministrationPort (server , model ['topology' ]), protocol = 'admin' )
487
490
elif index == 0 :
@@ -493,7 +496,7 @@ def addAdminChannelPortForwardNetworkAccessPoints(server):
493
496
ssl_listen_port = ssl ['ListenPort' ]
494
497
if ssl_listen_port is None :
495
498
ssl_listen_port = "7002"
496
- elif ssl is None and isSecureModeEnabledForDomain (model [ 'topology' ] ):
499
+ elif ssl is None and isSecureModeEnabledForDomain (model ):
497
500
ssl_listen_port = "7002"
498
501
499
502
if ssl_listen_port is not None :
0 commit comments