65
65
import subprocess
66
66
from diraccfg import CFG
67
67
from prompt_toolkit import prompt
68
+ from typing import cast
68
69
69
70
import DIRAC
70
71
from DIRAC import rootPath
@@ -170,7 +171,7 @@ def __init__(self):
170
171
gLogger .debug ("DIRAC Root Path =" , rootPath )
171
172
172
173
self .mysqlMode = ""
173
- self .localCfg = None
174
+ self .localCfg : CFG = None
174
175
self .cfgFile = ""
175
176
self .setup = ""
176
177
self .instance = ""
@@ -1364,10 +1365,20 @@ def setupSite(self, scriptCfg, cfg=None):
1364
1365
1365
1366
# Now get the necessary info from self.localCfg
1366
1367
setupSystems = self .localCfg .getOption (cfgInstallPath ("Systems" ), ["Configuration" , "Framework" ])
1368
+
1367
1369
setupDatabases = self .localCfg .getOption (cfgInstallPath ("Databases" ), [])
1368
- setupServices = [k .split ("/" ) for k in self .localCfg .getOption (cfgInstallPath ("Services" ), [])]
1369
- setupAgents = [k .split ("/" ) for k in self .localCfg .getOption (cfgInstallPath ("Agents" ), [])]
1370
- setupExecutors = [k .split ("/" ) for k in self .localCfg .getOption (cfgInstallPath ("Executors" ), [])]
1370
+ setupServices = [
1371
+ k .split ("/" )
1372
+ for k in self .localCfg .getOption (cfgInstallPath ("Services" ), []) # pylint: disable=not-an-iterable
1373
+ ]
1374
+ setupAgents = [
1375
+ k .split ("/" )
1376
+ for k in self .localCfg .getOption (cfgInstallPath ("Agents" ), []) # pylint: disable=not-an-iterable
1377
+ ]
1378
+ setupExecutors = [
1379
+ k .split ("/" )
1380
+ for k in self .localCfg .getOption (cfgInstallPath ("Executors" ), []) # pylint: disable=not-an-iterable
1381
+ ]
1371
1382
setupWeb = self .localCfg .getOption (cfgInstallPath ("WebPortal" ), False )
1372
1383
setupConfigurationMaster = self .localCfg .getOption (cfgInstallPath ("ConfigurationMaster" ), False )
1373
1384
setupPrivateConfiguration = self .localCfg .getOption (cfgInstallPath ("PrivateConfiguration" ), False )
@@ -1382,7 +1393,7 @@ def setupSite(self, scriptCfg, cfg=None):
1382
1393
DIRAC .exit (- 1 )
1383
1394
return S_ERROR (error )
1384
1395
serviceSysInstance = serviceTuple [0 ]
1385
- if serviceSysInstance not in setupSystems :
1396
+ if serviceSysInstance not in setupSystems : # pylint: disable=unsupported-membership-test
1386
1397
setupSystems .append (serviceSysInstance )
1387
1398
1388
1399
for agentTuple in setupAgents :
@@ -1393,7 +1404,7 @@ def setupSite(self, scriptCfg, cfg=None):
1393
1404
DIRAC .exit (- 1 )
1394
1405
return S_ERROR (error )
1395
1406
agentSysInstance = agentTuple [0 ]
1396
- if agentSysInstance not in setupSystems :
1407
+ if agentSysInstance not in setupSystems : # pylint: disable=unsupported-membership-test
1397
1408
setupSystems .append (agentSysInstance )
1398
1409
1399
1410
for executorTuple in setupExecutors :
@@ -1404,7 +1415,7 @@ def setupSite(self, scriptCfg, cfg=None):
1404
1415
DIRAC .exit (- 1 )
1405
1416
return S_ERROR (error )
1406
1417
executorSysInstance = executorTuple [0 ]
1407
- if executorSysInstance not in setupSystems :
1418
+ if executorSysInstance not in setupSystems : # pylint: disable=unsupported-membership-test
1408
1419
setupSystems .append (executorSysInstance )
1409
1420
1410
1421
# And to find out the available extensions
@@ -1521,7 +1532,7 @@ def setupSite(self, scriptCfg, cfg=None):
1521
1532
# info to be propagated, this may cause the later self.setup to fail
1522
1533
if setupAddConfiguration :
1523
1534
gLogger .notice ("Registering System instances" )
1524
- for system in setupSystems :
1535
+ for system in setupSystems : # pylint: disable=not-an-iterable
1525
1536
self .addSystemInstance (system , self .instance , self .setup , True )
1526
1537
for system , service in setupServices :
1527
1538
if not self .addDefaultOptionsToCS (None , "service" , system , service , extensions , overwrite = True )["OK" ]:
@@ -1570,7 +1581,7 @@ def setupSite(self, scriptCfg, cfg=None):
1570
1581
return result
1571
1582
dbDict = result ["Value" ]
1572
1583
1573
- for dbName in setupDatabases :
1584
+ for dbName in setupDatabases : # pylint: disable=not-an-iterable
1574
1585
gLogger .verbose ("Setting up database" , dbName )
1575
1586
if dbName not in installedDatabases :
1576
1587
result = self .installDatabase (dbName )
0 commit comments