diff --git a/docs/docs.conf b/docs/docs.conf index 1e7efef7575..870e5d28875 100644 --- a/docs/docs.conf +++ b/docs/docs.conf @@ -95,7 +95,7 @@ sectionPath = source/AdministratorGuide/CommandReference title = General information # [mandatory] pattern to match in the full path of the command names. -pattern = dirac-admin-service-ports, dirac-platform +pattern = dirac-platform # this list of patterns will reject scripts that are matched by the patterns above # exclude = user diff --git a/setup.cfg b/setup.cfg index 85469cada45..31e59d9390d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -205,7 +205,6 @@ console_scripts = dirac-admin-modify-user = DIRAC.Interfaces.scripts.dirac_admin_modify_user:main [admin] dirac-admin-pilot-summary = DIRAC.Interfaces.scripts.dirac_admin_pilot_summary:main [admin] dirac-admin-reset-job = DIRAC.Interfaces.scripts.dirac_admin_reset_job:main [admin] - dirac-admin-service-ports = DIRAC.Interfaces.scripts.dirac_admin_service_ports:main [admin] dirac-admin-set-site-protocols = DIRAC.Interfaces.scripts.dirac_admin_set_site_protocols:main [admin] dirac-admin-site-info = DIRAC.Interfaces.scripts.dirac_admin_site_info:main dirac-admin-site-mask-logging = DIRAC.Interfaces.scripts.dirac_admin_site_mask_logging:main [admin] diff --git a/src/DIRAC/Interfaces/API/DiracAdmin.py b/src/DIRAC/Interfaces/API/DiracAdmin.py index 51167069298..ee1be3e069f 100755 --- a/src/DIRAC/Interfaces/API/DiracAdmin.py +++ b/src/DIRAC/Interfaces/API/DiracAdmin.py @@ -258,65 +258,6 @@ def banSite(self, site, comment, printOutput=False): return result - ############################################################################# - def getServicePorts(self, setup="", printOutput=False): - """Checks the service ports for the specified setup. If not given this is - taken from the current installation (/DIRAC/Setup) - - Example usage: - - >>> gLogger.notice(diracAdmin.getServicePorts()) - {'OK': True, 'Value':''} - - :return: S_OK,S_ERROR - - """ - if not setup: - setup = gConfig.getValue("/DIRAC/Setup", "") - - setupList = gConfig.getSections("/DIRAC/Setups", []) - if not setupList["OK"]: - return S_ERROR("Could not get /DIRAC/Setups sections") - setupList = setupList["Value"] - if setup not in setupList: - return S_ERROR(f"Setup {setup} is not in allowed list: {', '.join(setupList)}") - - serviceSetups = gConfig.getOptionsDict(f"/DIRAC/Setups/{setup}") - if not serviceSetups["OK"]: - return S_ERROR(f"Could not get /DIRAC/Setups/{setup} options") - serviceSetups = serviceSetups["Value"] # dict - systemList = gConfig.getSections("/Systems") - if not systemList["OK"]: - return S_ERROR("Could not get Systems sections") - systemList = systemList["Value"] - result = {} - for system in systemList: - if system in serviceSetups: - path = f"/Systems/{system}/{serviceSetups[system]}/Services" - servicesList = gConfig.getSections(path) - if not servicesList["OK"]: - self.log.warn(f"Could not get sections in {path}") - else: - servicesList = servicesList["Value"] - if not servicesList: - servicesList = [] - self.log.verbose(f"System: {system} ServicesList: {', '.join(servicesList)}") - for service in servicesList: - spath = f"{path}/{service}/Port" - servicePort = gConfig.getValue(spath, 0) - if servicePort: - self.log.verbose(f"Found port for {system}/{service} = {servicePort}") - result[f"{system}/{service}"] = servicePort - else: - self.log.warn(f"No port found for {spath}") - else: - self.log.warn(f"{system} is not defined in /DIRAC/Setups/{setup}") - - if printOutput: - gLogger.notice(self.pPrint.pformat(result)) - - return S_OK(result) - ############################################################################# def getProxy(self, userDN, userGroup, validity=43200, limited=False): """Retrieves a proxy with default 12hr validity and stores diff --git a/src/DIRAC/Interfaces/scripts/dirac_admin_service_ports.py b/src/DIRAC/Interfaces/scripts/dirac_admin_service_ports.py deleted file mode 100755 index 4f2fcf439ba..00000000000 --- a/src/DIRAC/Interfaces/scripts/dirac_admin_service_ports.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -######################################################################## -# File : dirac-admin-service-ports -# Author : Stuart Paterson -######################################################################## -""" -Print the service ports for the specified setup - -Example: - $ dirac-admin-service-ports - {'Framework/ProxyManager': 9152, - 'Framework/SystemAdministrator': 9162, - 'Framework/UserProfileManager': 9155, - 'WorkloadManagement/JobManager': 9132, - 'WorkloadManagement/PilotManager': 9171, - 'WorkloadManagement/Matcher': 9170, - 'WorkloadManagement/SandboxStore': 9196, - 'WorkloadManagement/WMSAdministrator': 9145} -""" -import DIRAC -from DIRAC.Core.Base.Script import Script - - -@Script() -def main(): - # Registering arguments will automatically add their description to the help menu - Script.registerArgument("Setup: Name of the setup", default="", mandatory=False) - Script.parseCommandLine(ignoreErrors=True) - setup = Script.getPositionalArgs(group=True) - - from DIRAC.Interfaces.API.DiracAdmin import DiracAdmin - - diracAdmin = DiracAdmin() - result = diracAdmin.getServicePorts(setup, printOutput=True) - if result["OK"]: - DIRAC.exit(0) - else: - print(result["Message"]) - DIRAC.exit(2) - - -if __name__ == "__main__": - main() diff --git a/tests/.dirac-ci-config.yaml b/tests/.dirac-ci-config.yaml index f4a7470d182..9ba31ecceb4 100644 --- a/tests/.dirac-ci-config.yaml +++ b/tests/.dirac-ci-config.yaml @@ -4,7 +4,7 @@ config: CLIENT_UPLOAD_BASE64: SSBsaWtlIHBpenphIQo= CLIENT_UPLOAD_LFN: LFN:/vo/test_lfn.txt CLIENT_UPLOAD_FILE: test_lfn.txt - PILOT_INSTALLATION_COMMAND: dirac-pilot.py --modules /home/dirac/LocalRepo/ALTERNATIVE_MODULES/DIRAC -M 2 -S dirac-JenkinsSetup -N jenkins.cern.ch -Q jenkins-queue_not_important -n DIRAC.Jenkins.ch --pilotUUID=whatever12345 --cert --certLocation=/home/dirac/PilotInstallDIR/etc/grid-security --CVMFS_locations=/home/dirac/PilotInstallDIR -o diracInstallOnly --wnVO=vo --debug + PILOT_INSTALLATION_COMMAND: dirac-pilot.py --modules /home/dirac/LocalRepo/ALTERNATIVE_MODULES/DIRAC -M 2 -N jenkins.cern.ch -Q jenkins-queue_not_important -n DIRAC.Jenkins.ch --pilotUUID=whatever12345 --cert --certLocation=/home/dirac/PilotInstallDIR/etc/grid-security --CVMFS_locations=/home/dirac/PilotInstallDIR -o diracInstallOnly --wnVO=vo --debug PILOT_JSON: "{ \"timestamp\": \"2023-02-13T14:34:26.725499\", \"CEs\": { diff --git a/tests/Integration/WorkloadManagementSystem/Test_SandboxStoreClient.py b/tests/Integration/WorkloadManagementSystem/Test_SandboxStoreClient.py index 38a310a8f79..d5bbf3f8a1c 100644 --- a/tests/Integration/WorkloadManagementSystem/Test_SandboxStoreClient.py +++ b/tests/Integration/WorkloadManagementSystem/Test_SandboxStoreClient.py @@ -29,7 +29,6 @@ python -m pytest -c ../pytest.ini -vv tests/Integration/WorkloadManagementSystem/Test_SandboxStoreClient.py """ -from diraccfg import CFG import DIRAC @@ -39,28 +38,6 @@ from DIRAC.tests.Utilities.utils import find_all from DIRAC.WorkloadManagementSystem.Client.SandboxStoreClient import SandboxStoreClient -# cfg = CFG() -# cfg.loadFromBuffer( -# """ -# Systems -# { -# WorkloadManagement -# { -# dirac-JenkinsSetup -# { -# Services -# { -# SandboxStore -# { -# BasePath = /scratch/ -# } -# } -# } -# } -# } -# """ -# ) -# gConfig.loadCFG(cfg) gLogger.setLevel("DEBUG") diff --git a/tests/Jenkins/dirac-cfg-update-server.py b/tests/Jenkins/dirac-cfg-update-server.py index d7ebd375b91..39d4956afe3 100644 --- a/tests/Jenkins/dirac-cfg-update-server.py +++ b/tests/Jenkins/dirac-cfg-update-server.py @@ -10,8 +10,7 @@ Script.parseCommandLine() -args = Script.getPositionalArgs() -setupName = args[0] +setupName = "dirac-JenkinsSetup" # Where to store outputs if not os.path.isdir(f"{setupName}/sandboxes"): diff --git a/tests/Jenkins/dirac_ci.sh b/tests/Jenkins/dirac_ci.sh index f96613e2116..58d05702bcf 100644 --- a/tests/Jenkins/dirac_ci.sh +++ b/tests/Jenkins/dirac_ci.sh @@ -347,7 +347,7 @@ fullInstallDIRAC() { python "${TESTCODE}/DIRAC/tests/Jenkins/dirac-cfg-update-services.py" "${DEBUG}" #fix the SandboxStore and other stuff - python "${TESTCODE}/DIRAC/tests/Jenkins/dirac-cfg-update-server.py" dirac-JenkinsSetup "${DEBUG}" + python "${TESTCODE}/DIRAC/tests/Jenkins/dirac-cfg-update-server.py" "${DEBUG}" echo "==> Restarting Tornado Tornado" dirac-restart-component Tornado Tornado ${DEBUG} diff --git a/tests/Jenkins/install.cfg b/tests/Jenkins/install.cfg index 04f895faa82..d3f0d256e24 100644 --- a/tests/Jenkins/install.cfg +++ b/tests/Jenkins/install.cfg @@ -4,7 +4,6 @@ LocalInstallation Release = VAR_Release TargetPath = VAR_TargetPath SiteName = DIRAC.Jenkins.ch - Setup = dirac-JenkinsSetup InstanceName = Production VirtualOrganization = vo SkipCADownload = yes