예제 #1
0
#!/usr/bin/env python
########################################################################
# $HeadURL$
# File :    dirac-proxy-init.py
# Author :  Adrian Casajus
########################################################################
__RCSID__ = "$Id$"

import sys
import DIRAC
from DIRAC.Core.Base import Script
from DIRAC.FrameworkSystem.Client.ProxyGeneration import CLIParams, generateProxy

if __name__ == "__main__":
    cliParams = CLIParams()
    cliParams.registerCLISwitches()

    Script.disableCS()
    Script.parseCommandLine(ignoreErrors=True)

    retVal = generateProxy(cliParams)
    if not retVal['OK']:
        print retVal['Message']
        sys.exit(1)
    sys.exit(0)
예제 #2
0
def uploadProxyToDIRACProxyManager( params ):
  """ Upload proxy to the DIRAC ProxyManager service
  """

  gLogger.verbose( "Uploading user pilot proxy with group %s..." % ( params.getDIRACGroup() ) )
  params.onTheFly = True
  retVal = uploadProxy( params )
  if not retVal[ 'OK' ]:
    gLogger.error( " There was a problem generating proxy to be uploaded proxy manager: %s" % retVal[ 'Message' ] )
    return False
  return True


if __name__ == "__main__":

  cliParams = CLIParams()
  cliParams.registerCLISwitches()

  Script.setUsageMessage( '\n'.join( [ __doc__.split( '\n' )[1],
                                       'Usage:',
                                       '  %s [option|cfgfile] ...' % Script.scriptName, ] ) )
  Script.disableCS()
  Script.parseCommandLine()
  gConfig.setOptionValue( "/DIRAC/Security/UseServerCertificate", "no" )

  diracGroup = cliParams.getDIRACGroup()
  time = cliParams.getProxyLifeTime()

  retVal = generateProxy( cliParams )
  if not retVal[ 'OK' ]:
    gLogger.error( "Can't create a proxy: %s" % retVal[ 'Message' ] )
예제 #3
0
#  Example:
#   python test_wrapperScript.py | tee script.py && chmod +x script.py && ./script.py
#
__RCSID__ = "$Id: DIRACPilotDirector.py 28536 2010-09-23 06:08:40Z rgracian $"

from DIRAC.Core.Base import Script
from DIRAC.FrameworkSystem.Client.ProxyGeneration import CLIParams, generateProxy
from DIRAC.Core.Security.Locations import getProxyLocation
from DIRAC.Core.Security.X509Chain import X509Chain

Script.disableCS()
Script.parseCommandLine()

proxyFile = getProxyLocation()
if not proxyFile:
    retVal = generateProxy(CLIParams())
    if not retVal['OK']:
        proxy = None
    else:
        proxy = X509Chain()
        proxy.loadChainFromFile(retVal['Value'])
else:
    proxy = X509Chain()
    proxy.loadChainFromFile(proxyFile)

from DIRAC.Resources.Computing import Pilot
import os

pilotFile = Pilot.__file__

print Pilot.wrapperScript(
예제 #4
0
#!/usr/bin/env python
########################################################################
# $HeadURL$
# File :    dirac-proxy-init.py
# Author :  Adrian Casajus
########################################################################
__RCSID__ = "$Id$"

import sys
import DIRAC
from DIRAC.Core.Base import Script
from DIRAC.FrameworkSystem.Client.ProxyGeneration import CLIParams, generateProxy

if __name__ == "__main__":
  cliParams = CLIParams()
  cliParams.registerCLISwitches()

  Script.disableCS()
  Script.parseCommandLine( ignoreErrors = True )

  retVal = generateProxy( cliParams )
  if not retVal[ 'OK' ]:
    print retVal[ 'Message' ]
    sys.exit( 1 )
  sys.exit( 0 )