Skip to content

Commit 271c7e3

Browse files
authored
Merge pull request #5730 from chrisburr/cherry-pick-2-981776903-integration
[sweep:integration] Add URLs to CS when installing HTTPS services
2 parents 2d0f02f + e4c8cf0 commit 271c7e3

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/DIRAC/FrameworkSystem/Client/ComponentInstaller.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,12 +864,22 @@ def getComponentCfg(
864864
# Add the service URL
865865
if componentType == "service":
866866
port = compCfg.getOption("Port", 0)
867-
if port and self.host:
867+
protocol = compCfg.getOption("Protocol", "dips")
868+
if (port or protocol == "https") and self.host:
868869
urlsPath = cfgPath("Systems", system, compInstance, "URLs")
869870
cfg.createNewSection(urlsPath)
870871
failoverUrlsPath = cfgPath("Systems", system, compInstance, "FailoverURLs")
871872
cfg.createNewSection(failoverUrlsPath)
872-
cfg.setOption(cfgPath(urlsPath, component), "dips://%s:%d/%s/%s" % (self.host, port, system, component))
873+
if protocol == "https":
874+
cfg.setOption(
875+
# Strip "Tornado" from the beginning of component name if present
876+
cfgPath(urlsPath, component[len("Tornado") if component.startswith("Tornado") else 0 :]),
877+
"https://%s:8443/%s/%s" % (self.host, system, component),
878+
)
879+
else:
880+
cfg.setOption(
881+
cfgPath(urlsPath, component), "dips://%s:%d/%s/%s" % (self.host, port, system, component)
882+
)
873883

874884
return S_OK(cfg)
875885

tests/CI/install_server.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,12 @@ then
8989
# We ignore the Configuration for now because it is a bit special (the master needs to run in a separate process)
9090
# system_component is a space separated System (without the word System), and Component, without the 'Handler.py'.
9191
# For example "DataManagement TornadoFileCatalog"
92-
93-
find "/home/dirac/LocalRepo/ALTERNATIVE_MODULES/DIRAC" -name 'Tornado*Handler.py' | grep -v Configuration | sed -e 's/Handler.py//g' -e 's/System//g'| awk -F '/' '{print $(NF-2), $NF}' > tornadoServices
94-
cfgProdFile="${SERVERINSTALLDIR}"/diracos/etc/Production.cfg
95-
9692
while read -r system_component; do
9793
echo -e "*** $(date -u) **** Installing Tornado service ${system_component}"
9894
# do NOT put quotes around ${system_component} since
9995
# we want it to be seen as two arguments
10096
# shellcheck disable=SC2086
10197
dirac-install-tornado-service -ddd ${system_component};
102-
# origin_component is the original service before Tornado (FileCatalog vs TornadoFileCatalog for example)
103-
orig_component=$(echo "${system_component}" | sed 's/Tornado//g' | awk '{print $2}');
104-
# Replace the dips url with the https url in the cs, assuming port 8443
105-
sed -E "s|( +${orig_component} = )dips://([a-z]+)(:[0-9]+)(/.*/)(.*)|\1https://\2:8443\4Tornado\5|g" -i "$cfgProdFile"
10698
# Restart the CS to take all that into account
10799
sleep 1
108100
dirac-restart-component Configuration Server "$DEBUG"

0 commit comments

Comments
 (0)