Skip to content

Commit

Permalink
fix: removed useless dirac_admin_service_ports.py script
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Nov 20, 2024
1 parent 9a86dd5 commit 8900fbb
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 132 deletions.
2 changes: 1 addition & 1 deletion docs/docs.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
59 changes: 0 additions & 59 deletions src/DIRAC/Interfaces/API/DiracAdmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 0 additions & 43 deletions src/DIRAC/Interfaces/scripts/dirac_admin_service_ports.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/.dirac-ci-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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\": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
python -m pytest -c ../pytest.ini -vv tests/Integration/WorkloadManagementSystem/Test_SandboxStoreClient.py
"""

from diraccfg import CFG

import DIRAC

Expand All @@ -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")

Expand Down
3 changes: 1 addition & 2 deletions tests/Jenkins/dirac-cfg-update-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
2 changes: 1 addition & 1 deletion tests/Jenkins/dirac_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 0 additions & 1 deletion tests/Jenkins/install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ LocalInstallation
Release = VAR_Release
TargetPath = VAR_TargetPath
SiteName = DIRAC.Jenkins.ch
Setup = dirac-JenkinsSetup
InstanceName = Production
VirtualOrganization = vo
SkipCADownload = yes
Expand Down

0 comments on commit 8900fbb

Please sign in to comment.