Exemplo n.º 1
0
def _updateFromRemoteLocation(serviceClient):
  gLogger.debug("", "Trying to refresh from %s" % serviceClient.serviceURL)
  localVersion = gConfigurationData.getVersion()
  retVal = serviceClient.getCompressedDataIfNewer(localVersion)
  if retVal['OK']:
    dataDict = retVal['Value']
    if localVersion < dataDict['newestVersion']:
      gLogger.debug("New version available", "Updating to version %s..." % dataDict['newestVersion'])
      gConfigurationData.loadRemoteCFGFromCompressedMem(dataDict['data'])
      gLogger.debug("Updated to version %s" % gConfigurationData.getVersion())
      gEventDispatcher.triggerEvent("CSNewVersion", dataDict['newestVersion'], threaded=True)
    return S_OK()
  return retVal
Exemplo n.º 2
0
def _updateFromRemoteLocation( serviceClient ):
  gLogger.debug( "", "Trying to refresh from %s" % serviceClient.serviceURL )
  localVersion = gConfigurationData.getVersion()
  retVal = serviceClient.getCompressedDataIfNewer( localVersion )
  if retVal[ 'OK' ]:
    dataDict = retVal[ 'Value' ]
    if localVersion < dataDict[ 'newestVersion' ] :
      gLogger.debug( "New version available", "Updating to version %s..." % dataDict[ 'newestVersion' ] )
      gConfigurationData.loadRemoteCFGFromCompressedMem( dataDict[ 'data' ] )
      gLogger.debug( "Updated to version %s" % gConfigurationData.getVersion() )
      gEventDispatcher.triggerEvent( "CSNewVersion", dataDict[ 'newestVersion' ], threaded = True )
    return S_OK()
  return retVal
Exemplo n.º 3
0
def _updateFromRemoteLocation(serviceClient):
    """
    Refresh the configuration
    """
    gLogger.debug("", "Trying to refresh from %s" % serviceClient.serverURL)
    localVersion = gConfigurationData.getVersion()
    retVal = serviceClient.getCompressedDataIfNewer(localVersion)
    if retVal["OK"]:
        dataDict = retVal["Value"]
        newestVersion = dataDict["newestVersion"]
        if localVersion < newestVersion:
            gLogger.debug("New version available",
                          "Updating to version %s..." % newestVersion)
            gConfigurationData.loadRemoteCFGFromCompressedMem(dataDict["data"])
            gLogger.debug("Updated to version %s" %
                          gConfigurationData.getVersion())
            gEventDispatcher.triggerEvent("CSNewVersion",
                                          newestVersion,
                                          threaded=True)
        return S_OK()
    return retVal