Beispiel #1
0
def main():
  cliParams = Params()

  Script.disableCS()
  Script.registerSwitch(
      "e",
      "exitOnError",
      "flag to exit on error of any component installation",
      cliParams.setExitOnError)

  Script.addDefaultOptionValue('/DIRAC/Security/UseServerCertificate', 'yes')
  Script.addDefaultOptionValue('LogLevel', 'INFO')
  Script.parseCommandLine()
  args = Script.getExtraCLICFGFiles()

  if len(args) > 1:
    Script.showHelp(exitCode=1)

  cfg = None
  if len(args):
    cfg = args[0]
  from DIRAC.FrameworkSystem.Client.ComponentInstaller import gComponentInstaller

  gComponentInstaller.exitOnError = cliParams.exitOnError

  result = gComponentInstaller.setupSite(Script.localCfg, cfg)
  if not result['OK']:
    print("ERROR:", result['Message'])
    exit(-1)

  result = gComponentInstaller.getStartupComponentStatus([])
  if not result['OK']:
    print('ERROR:', result['Message'])
    exit(-1)

  print("\nStatus of installed components:\n")
  result = gComponentInstaller.printStartupStatus(result['Value'])
  if not result['OK']:
    print('ERROR:', result['Message'])
    exit(-1)
Beispiel #2
0
Script.addDefaultOptionValue('/DIRAC/Security/UseServerCertificate', 'yes')
Script.addDefaultOptionValue('LogLevel', 'INFO')
Script.parseCommandLine()
args = Script.getExtraCLICFGFiles()
#
if len(args) > 1:
  Script.showHelp(exitCode=1)
#
cfg = None
if len(args):
  cfg = args[0]
from DIRAC.FrameworkSystem.Client.ComponentInstaller import gComponentInstaller
#
gComponentInstaller.exitOnError = cliParams.exitOnError
#
result = gComponentInstaller.setupSite(Script.localCfg, cfg)
if not result['OK']:
  print("ERROR:", result['Message'])
  exit(-1)
#
result = gComponentInstaller.getStartupComponentStatus([])
if not result['OK']:
  print('ERROR:', result['Message'])
  exit(-1)

print("\nStatus of installed components:\n")
result = gComponentInstaller.printStartupStatus(result['Value'])
if not result['OK']:
  print('ERROR:', result['Message'])
  exit(-1)
Beispiel #3
0
Script.addDefaultOptionValue( 'LogLevel', 'INFO' )
Script.parseCommandLine()
args = Script.getExtraCLICFGFiles()
#
if len( args ) > 1:
  Script.showHelp()
  exit( -1 )
#
cfg = None
if len( args ):
  cfg = args[0]
from DIRAC.FrameworkSystem.Client.ComponentInstaller import gComponentInstaller
#
gComponentInstaller.exitOnError = cliParams.exitOnError
#
result = gComponentInstaller.setupSite( Script.localCfg, cfg )
if not result['OK']:
  print "ERROR:", result['Message']
  exit( -1 )
#
result = gComponentInstaller.getStartupComponentStatus( [] )
if not result['OK']:
  print 'ERROR:', result['Message']
  exit( -1 )

print "\nStatus of installed components:\n"
result = gComponentInstaller.printStartupStatus( result['Value'] )
if not result['OK']:
  print 'ERROR:', result['Message']
  exit( -1 )