Skip to content

Commit 35b9c17

Browse files
committed
fix: use dirac-proxy-init instead of dirac-login
1 parent d20fbd7 commit 35b9c17

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

integration_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def install_server():
378378
# for the diracx container to use
379379
# It needs to be started and running before the DIRAC server installation
380380
# because after installing the databases, the install server script
381-
# calls dirac-login.
381+
# calls dirac-proxy-init.
382382
# At this point we need the new CS to have been updated
383383
# already else the token exchange fails.
384384

src/DIRAC/FrameworkSystem/scripts/dirac_proxy_init.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@
66
$ dirac-proxy-init -g dirac_user
77
Enter Certificate password: **************
88
"""
9+
import datetime
10+
import glob
911
import os
1012
import sys
11-
import glob
1213
import time
13-
import datetime
1414

1515
import DIRAC
16-
17-
from DIRAC import gLogger, gConfig, S_OK, S_ERROR
16+
from DIRAC import S_ERROR, S_OK, gLogger
17+
from DIRAC.ConfigurationSystem.Client.Helpers import Registry
1818
from DIRAC.Core.Base.Script import Script
19-
from DIRAC.FrameworkSystem.Client import ProxyGeneration, ProxyUpload
20-
from DIRAC.Core.Security import X509Chain, ProxyInfo, VOMS
19+
from DIRAC.Core.Security import VOMS, ProxyInfo, X509Chain
2120
from DIRAC.Core.Security.DiracX import addTokenToPEM
2221
from DIRAC.Core.Security.Locations import getCAsLocation, getDefaultProxyLocation
23-
from DIRAC.ConfigurationSystem.Client.Helpers import Registry
22+
from DIRAC.FrameworkSystem.Client import ProxyGeneration, ProxyUpload
2423
from DIRAC.FrameworkSystem.Client.BundleDeliveryClient import BundleDeliveryClient
2524

2625

tests/CI/install_client.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ echo -e "*** $(date -u) **** Client INSTALLATION START ****\n"
6161
installDIRAC
6262

6363
echo -e "*** $(date -u) Getting a non privileged user\n" |& tee -a clientTestOutputs.txt
64-
dirac-login -C "${SERVERINSTALLDIR}/user/client.pem" -K "${SERVERINSTALLDIR}/user/client.key" "${DEBUG}" |& tee -a clientTestOutputs.txt
64+
dirac-proxy-init -C "${SERVERINSTALLDIR}/user/client.pem" -K "${SERVERINSTALLDIR}/user/client.key" "${DEBUG}" |& tee -a clientTestOutputs.txt
6565

6666
#-------------------------------------------------------------------------------#
6767
echo -e "*** $(date -u) **** Submit a job ****\n"

tests/Jenkins/utilities.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ installDIRAC() {
247247
echo "source \"$PWD/diracos/diracosrc\"" > "$PWD/bashrc"
248248
echo "export X509_CERT_DIR=\"$PWD/diracos/etc/grid-security/certificates\"" >> "$PWD/bashrc"
249249
source diracos/diracosrc
250+
251+
# Copy the user cert and key to the correct directory
252+
cp /ca/certs/client.pem "${SERVERINSTALLDIR}/user/"
253+
cp /ca/certs/client.key "${SERVERINSTALLDIR}/user/"
254+
cp /ca/certs/client.pem /home/dirac/.globus/usercert.pem
255+
cp /ca/certs/client.key /home/dirac/.globus/userkey.pem
256+
250257
if [[ -n "${DIRAC_RELEASE+x}" ]]; then
251258
if [[ -z "${ALTERNATIVE_MODULES}" ]]; then
252259
pip install DIRAC "${DIRAC_RELEASE}"
@@ -388,8 +395,8 @@ diracCredentials() {
388395
echo '==> [diracCredentials]'
389396

390397
sed -i 's/commitNewData = CSAdministrator/commitNewData = authenticated/g' "${SERVERINSTALLDIR}/etc/Configuration_Server.cfg"
391-
if ! dirac-login dirac_admin --nocs -C "${SERVERINSTALLDIR}/user/client.pem" -K "${SERVERINSTALLDIR}/user/client.key" -T 72 "${DEBUG}"; then
392-
echo 'ERROR: dirac-login failed' >&2
398+
if ! dirac-proxy-init dirac_admin --nocs -C "${SERVERINSTALLDIR}/user/client.pem" -K "${SERVERINSTALLDIR}/user/client.key" "${DEBUG}"; then
399+
echo 'ERROR: dirac-proxy-init failed' >&2
393400
exit 1
394401
fi
395402
sed -i 's/commitNewData = authenticated/commitNewData = CSAdministrator/g' "${SERVERINSTALLDIR}/etc/Configuration_Server.cfg"
@@ -471,21 +478,21 @@ diracProxies() {
471478
if [[ -n $TEST_DIRACX ]]; then
472479
echo "Waiting for for DiracX to be available" >&2
473480
for i in {1..10}; do
474-
if dirac-login -C "${SERVERINSTALLDIR}/user/client.pem" -K "${SERVERINSTALLDIR}/user/client.key" -T 72 "${DEBUG}"; then
481+
if dirac-proxy-init -C "${SERVERINSTALLDIR}/user/client.pem" -K "${SERVERINSTALLDIR}/user/client.key" "${DEBUG}"; then
475482
break
476483
fi
477484
sleep 5
478485
done
479486
fi
480487

481488
# User proxy
482-
if ! dirac-login -C "${SERVERINSTALLDIR}/user/client.pem" -K "${SERVERINSTALLDIR}/user/client.key" -T 72 "${DEBUG}"; then
483-
echo 'ERROR: dirac-login failed' >&2
489+
if ! dirac-proxy-init -C "${SERVERINSTALLDIR}/user/client.pem" -K "${SERVERINSTALLDIR}/user/client.key" "${DEBUG}"; then
490+
echo 'ERROR: dirac-init failed' >&2
484491
exit 1
485492
fi
486493
# group proxy
487-
if ! dirac-login prod -C "${SERVERINSTALLDIR}/user/client.pem" -K "${SERVERINSTALLDIR}/user/client.key" -T 72 "${DEBUG}"; then
488-
echo 'ERROR: dirac-login failed' >&2
494+
if ! dirac-proxy-init prod -C "${SERVERINSTALLDIR}/user/client.pem" -K "${SERVERINSTALLDIR}/user/client.key" "${DEBUG}"; then
495+
echo 'ERROR: dirac-init failed' >&2
489496
exit 1
490497
fi
491498
}

0 commit comments

Comments
 (0)