Exemplo n.º 1
0
 def getExternalPackageVersions( self ):
   """ Simple function that attempts to obtain the external versions for
       the local DIRAC installation (frequently needed for debugging purposes).
   """
   gLogger.info( 'DIRAC version v%dr%d build %d' % ( DIRAC.majorVersion, DIRAC.minorVersion, DIRAC.patchLevel ) )
   try:
     import lcg_util
     infoStr = 'Using lcg_util from: \n%s' % lcg_util.__file__
     gLogger.info( infoStr )
     infoStr = "The version of lcg_utils is %s" % lcg_util.lcg_util_version()
     gLogger.info( infoStr )
   except Exception, x:
     errStr = "SRM2Storage.__init__: Failed to import lcg_util: %s" % ( x )
     gLogger.exception( errStr )
Exemplo n.º 2
0
 def getExternalPackageVersions( self ):
   """ 
   Simple function that attempts to obtain the external versions for
   the local DIRAC installation (frequently needed for debugging purposes).
   """
   gLogger.info( 'DIRAC version v%dr%d build %d' % ( DIRAC.majorVersion, DIRAC.minorVersion, DIRAC.patchLevel ) )
   try:
     import lcg_util
     infoStr = 'Using lcg_util from: \n%s' % lcg_util.__file__
     gLogger.info( infoStr )
     infoStr = "The version of lcg_utils is %s" % lcg_util.lcg_util_version()
     gLogger.info( infoStr )
   except Exception, x:
     errStr = "SRM2Storage.__init__: Failed to import lcg_util: %s" % ( x )
     gLogger.exception( errStr )
Exemplo n.º 3
0
    def getExternalPackageVersions(self):
        """
    Simple function that attempts to obtain the external versions for
    the local DIRAC installation (frequently needed for debugging purposes).
    """
        gLogger.info(
            'DIRAC version v%dr%d build %d' %
            (DIRAC.majorVersion, DIRAC.minorVersion, DIRAC.patchLevel))
        try:
            import lcg_util
            infoStr = 'Using lcg_util from: \n%s' % lcg_util.__file__
            gLogger.info(infoStr)
            infoStr = "The version of lcg_utils is %s" % lcg_util.lcg_util_version(
            )
            gLogger.info(infoStr)
        except Exception as x:
            errStr = "SRM2Storage.__init__: Failed to import lcg_util: %s" % (
                x)
            gLogger.exception(errStr)

        try:
            import gfalthr as gfal
            infoStr = "Using gfalthr from: \n%s" % gfal.__file__
            gLogger.info(infoStr)
            infoStr = "The version of gfalthr is %s" % gfal.gfal_version()
            gLogger.info(infoStr)
        except Exception as x:
            errStr = "SRM2Storage.__init__: Failed to import gfalthr: %s." % (
                x)
            gLogger.warn(errStr)
            try:
                import gfal
                infoStr = "Using gfal from: %s" % gfal.__file__
                gLogger.info(infoStr)
                infoStr = "The version of gfal is %s" % gfal.gfal_version()
                gLogger.info(infoStr)
            except Exception as x:
                errStr = "SRM2Storage.__init__: Failed to import gfal: %s" % (
                    x)
                gLogger.exception(errStr)

        defaultProtocols = gConfig.getValue(
            '/Resources/StorageElements/DefaultProtocols', [])
        gLogger.info('Default list of protocols are: %s' %
                     (', '.join(defaultProtocols)))
        return S_OK()
Exemplo n.º 4
0
    def getExternalPackageVersions(self):
        """
    Simple function that attempts to obtain the external versions for
    the local DIRAC installation (frequently needed for debugging purposes).
    """
        gLogger.info("DIRAC version v%dr%d build %d" % (DIRAC.majorVersion, DIRAC.minorVersion, DIRAC.patchLevel))
        try:
            import lcg_util

            infoStr = "Using lcg_util from: \n%s" % lcg_util.__file__
            gLogger.info(infoStr)
            infoStr = "The version of lcg_utils is %s" % lcg_util.lcg_util_version()
            gLogger.info(infoStr)
        except Exception as x:
            errStr = "SRM2Storage.__init__: Failed to import lcg_util: %s" % (x)
            gLogger.exception(errStr)

        try:
            import gfalthr as gfal

            infoStr = "Using gfalthr from: \n%s" % gfal.__file__
            gLogger.info(infoStr)
            infoStr = "The version of gfalthr is %s" % gfal.gfal_version()
            gLogger.info(infoStr)
        except Exception as x:
            errStr = "SRM2Storage.__init__: Failed to import gfalthr: %s." % (x)
            gLogger.warn(errStr)
            try:
                import gfal

                infoStr = "Using gfal from: %s" % gfal.__file__
                gLogger.info(infoStr)
                infoStr = "The version of gfal is %s" % gfal.gfal_version()
                gLogger.info(infoStr)
            except Exception as x:
                errStr = "SRM2Storage.__init__: Failed to import gfal: %s" % (x)
                gLogger.exception(errStr)

        defaultProtocols = gConfig.getValue("/Resources/StorageElements/DefaultProtocols", [])
        gLogger.info("Default list of protocols are: %s" % (", ".join(defaultProtocols)))
        return S_OK()
Exemplo n.º 5
0
    records.append(('Proxy validity, secs', {'Value': str(ret['Value']['secondsLeft']), 'Just': 'L'}))

if gConfig.getValue('/DIRAC/Security/UseServerCertificate', True):
  records.append(('Use Server Certificate', 'Yes'))
else:
  records.append(('Use Server Certificate', 'No'))
if gConfig.getValue('/DIRAC/Security/SkipCAChecks', False):
  records.append(('Skip CA Checks', 'Yes'))
else:
  records.append(('Skip CA Checks', 'No'))

try:
  import gfalthr  # pylint: disable=import-error
  records.append(('gfal version', gfalthr.gfal_version()))
except BaseException:
  pass

try:
  import lcg_util  # pylint: disable=import-error
  records.append(('lcg_util version', lcg_util.lcg_util_version()))
except BaseException:
  pass

records.append(('DIRAC version', DIRAC.version))

fields = ['Option', 'Value']

print()
printTable(fields, records, numbering=False)
print()
Exemplo n.º 6
0
Script.parseCommandLine(ignoreErrors=True)
args = Script.getPositionalArgs()

infoDict = {}

infoDict['Setup'] = gConfig.getValue('/DIRAC/Setup', 'Unknown')
infoDict['ConfigurationServer'] = gConfig.getValue(
    '/DIRAC/Configuration/Servers', [])
ret = getProxyInfo(disableVOMS=True)
if ret['OK'] and 'group' in ret['Value']:
    infoDict['VirtualOrganization'] = getVOForGroup(ret['Value']['group'])
else:
    infoDict['VirtualOrganization'] = getVOForGroup('')

try:
    import gfalthr
    infoDict['gfal version'] = gfalthr.gfal_version()
except:
    pass

try:
    import lcg_util
    infoDict['lcg_util version'] = lcg_util.lcg_util_version()
except:
    pass

print 'DIRAC version'.rjust(20), ':', DIRAC.version

for k, v in infoDict.items():
    print k.rjust(20), ':', str(v)
Exemplo n.º 7
0
                                     '  %s [option|cfgfile] ... Site' % Script.scriptName, ] ) )
Script.parseCommandLine( ignoreErrors = True )
args = Script.getPositionalArgs()

infoDict = {}

infoDict['Setup'] = gConfig.getValue( '/DIRAC/Setup', 'Unknown' )
infoDict['ConfigurationServer'] = gConfig.getValue( '/DIRAC/Configuration/Servers', [] )
ret = getProxyInfo( disableVOMS = True )
if ret['OK'] and 'group' in ret['Value']:
  infoDict['VirtualOrganization'] = getVOForGroup( ret['Value']['group'] )
else:
  infoDict['VirtualOrganization'] = getVOForGroup( '' )
  
try:
  import gfalthr
  infoDict['gfal version'] = gfalthr.gfal_version()
except:
  pass

try:
  import lcg_util
  infoDict['lcg_util version'] = lcg_util.lcg_util_version()
except:
  pass    

print 'DIRAC version'.rjust( 20 ), ':', DIRAC.version

for k, v in infoDict.items():
  print k.rjust( 20 ), ':', str( v )
Exemplo n.º 8
0
  
if gConfig.getValue( '/DIRAC/Security/UseServerCertificate', True ):
  records.append( ('Use Server Certificate', 'Yes' ) )
else:
  records.append( ('Use Server Certificate', 'No' ) )
if gConfig.getValue( '/DIRAC/Security/SkipCAChecks', False ):
  records.append( ('Skip CA Checks', 'Yes' ) )
else:
  records.append( ('Skip CA Checks', 'No' ) )
    
  
try:
  import gfalthr
  records.append( ('gfal version', gfalthr.gfal_version() ) )
except:
  pass

try:
  import lcg_util
  records.append( ('lcg_util version', lcg_util.lcg_util_version() ) )
except:
  pass    

records.append( ('DIRAC version', DIRAC.version ) )

fields = ['Option','Value']

print
printTable( fields, records, numbering=False )
print