Skip to content

Commit

Permalink
fix: simplified call to dirac-admin-add-pilot
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Sep 28, 2023
1 parent 92d9da5 commit c0fcea0
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions Pilot/pilotCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,27 +635,17 @@ def execute(self):
"""Calls dirac-admin-add-pilot"""

if self.pp.useServerCertificate:
self.cfg.append("-o /DIRAC/Security/UseServerCertificate=yes")
extractDNCommand = "openssl x509 -in %s/hostcert.pem " % self.pp.certsLocation
extractDNCommand += "-noout -subject -nameopt compat | sed 's/subject=//'"
retCode, res = self.executeAndGetOutput(extractDNCommand, self.pp.installEnv)
if retCode:
self.log.error("Could not get execute %s [ERROR %d]" % (extractDNCommand, retCode))
self.exitWithError(retCode)
pilotOwnerDN = res.strip().split("\n")[-1]
pilotOwnerGroup = "certificate_group"
else:
pilotOwnerDN = self.pp.userDN
pilotOwnerGroup = self.pp.userGroup

if self.pp.localConfigFile:
if LooseVersion(self.releaseVersion) >= self.cfgOptionDIRACVersion:
self.cfg.append("--cfg")
self.cfg.append(self.pp.localConfigFile) # this file is as input

checkCmd = "dirac-admin-add-pilot %s %s %s %s %s --status=Running %s -d" % (
checkCmd = "dirac-admin-add-pilot %s %s %s %s --status=Running %s -d" % (
self.pp.pilotReference,
pilotOwnerDN,
pilotOwnerGroup,
self.pp.flavour,
self.pilotStamp,
Expand Down

0 comments on commit c0fcea0

Please sign in to comment.