def _banStorageElement( self, storageElement ):
		
		endpoints = getFTS3Servers()[ 'Value' ]
		
		blacklist = {}
		for endpoint in endpoints:
			#endpoint = 'https://fts3-pilot.cern.ch:8446'
			
			#TODO: maybe proxyPath is not needed since it is picked from the environment by the REST API
			proxyPath = getProxyInfo()
			if not proxyPath.get('OK'):
				return S_ERROR("Proxy not found!")
			
			try:
				proxyPath = proxyPath.get('Value').get('path')
			except Exception as e:
				return S_ERROR(e.message)			
			
			context = fts3.Context(endpoint, proxyPath)
			timeout = 3600  #or...?
			status = 'wait' #or...?
			allow_submit = False #or...?
			
			#TODO: ban_se returns the list of jobIDs interrupted by the banning
			pausedJobIDs = fts3.ban_se(context, storageElement, status, timeout, allow_submit)
			
			blacklist[endpoint] = json.loads(context.get("ban/se"))
		
		return S_OK( blacklist )
							
################################################################################
#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF
  def _banStorageElement( self, storageElement ):

    endpoints = getFTS3Servers()[ 'Value' ]

    blacklist = {}
    for endpoint in endpoints:
      # endpoint = 'https://fts3-pilot.cern.ch:8446'

      # TODO: maybe proxyPath is not needed since it is picked from the environment by the REST API
      proxyPath = getProxyInfo()
      if not proxyPath['OK']:
        return proxyPath

      try:
        proxyPath = proxyPath['Value']['path']
      except Exception as e:
        return S_ERROR( repr( e ).replace( ',)', ')' ) )

      context = fts3.Context( endpoint, proxyPath )
      timeout = 3600  # or...?
      status = 'wait'  # or...?
      allow_submit = False  # or...?

      # TODO: ban_se returns the list of jobIDs interrupted by the banning
      pausedJobIDs = fts3.ban_se( context, storageElement, status, timeout, allow_submit )
      self.log.info( "fts3.ban_se: %s" % pausedJobIDs )

      blacklist[endpoint] = json.loads( context.get( "ban/se" ) )

    return S_OK( blacklist )
    def _banStorageElement(self, storageElement):

        endpoints = getFTS3Servers()['Value']

        blacklist = {}
        for endpoint in endpoints:
            #endpoint = 'https://fts3-pilot.cern.ch:8446'

            #TODO: maybe proxyPath is not needed since it is picked from the environment by the REST API
            proxyPath = getProxyInfo()
            if not proxyPath.get('OK'):
                return S_ERROR("Proxy not found!")

            try:
                proxyPath = proxyPath.get('Value').get('path')
            except Exception as e:
                return S_ERROR(e.message)

            context = fts3.Context(endpoint, proxyPath)
            timeout = 3600  #or...?
            status = 'wait'  #or...?
            allow_submit = False  #or...?

            #TODO: ban_se returns the list of jobIDs interrupted by the banning
            pausedJobIDs = fts3.ban_se(context, storageElement, status,
                                       timeout, allow_submit)

            blacklist[endpoint] = json.loads(context.get("ban/se"))

        return S_OK(blacklist)


################################################################################
#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF
Example #4
0
  def _banStorageElement( self, storageElement ):

    endpoints = getFTS3Servers()
    if not endpoints['OK']:
      return endpoints

    endpoints = endpoints['Value']

    blacklist = {}
    for endpoint in endpoints:
      # endpoint = 'https://fts3-pilot.cern.ch:8446'

      # TODO: maybe proxyPath is not needed since it is picked from the environment by the REST API
      proxyPath = getProxyInfo()
      if not proxyPath['OK']:
        return proxyPath

      try:
        proxyPath = proxyPath['Value']['path']
      except Exception as e:
        return S_ERROR( repr( e ).replace( ',)', ')' ) )

      context = fts3.Context( endpoint, proxyPath )
      status = 'wait'  # This status leaves the jobs queued. The only alternative is "cancel"

      pausedJobIDs = fts3.ban_se( context, storageElement, status, timeout = 3600, allow_submit = False )
      self.log.info( "fts3.ban_se: paused jobs: %s" % ','.join(pausedJobIDs) )

      blacklist[endpoint] = json.loads( context.get( "ban/se" ) )

    return S_OK( blacklist )
Example #5
0
    def _banStorageElement(self, storageElement):

        endpoints = getFTS3Servers()['Value']

        blacklist = {}
        for endpoint in endpoints:
            # endpoint = 'https://fts3-pilot.cern.ch:8446'

            # TODO: maybe proxyPath is not needed since it is picked from the environment by the REST API
            proxyPath = getProxyInfo()
            if not proxyPath['OK']:
                return proxyPath

            try:
                proxyPath = proxyPath['Value']['path']
            except Exception as e:
                return S_ERROR(repr(e).replace(',)', ')'))

            context = fts3.Context(endpoint, proxyPath)
            timeout = 3600  # or...?
            status = 'wait'  # or...?
            allow_submit = False  # or...?

            # TODO: ban_se returns the list of jobIDs interrupted by the banning
            pausedJobIDs = fts3.ban_se(context, storageElement, status,
                                       timeout, allow_submit)
            self.log.info("fts3.ban_se: %s" % pausedJobIDs)

            blacklist[endpoint] = json.loads(context.get("ban/se"))

        return S_OK(blacklist)
Example #6
0
    def _banStorageElement(self, storageElement):

        endpoints = getFTS3Servers()
        if not endpoints['OK']:
            return endpoints

        endpoints = endpoints['Value']

        blacklist = {}
        for endpoint in endpoints:
            # endpoint = 'https://fts3-pilot.cern.ch:8446'

            # TODO: maybe proxyPath is not needed since it is picked from the environment by the REST API
            proxyPath = getProxyInfo()
            if not proxyPath['OK']:
                return proxyPath

            try:
                proxyPath = proxyPath['Value']['path']
            except Exception as e:
                return S_ERROR(repr(e).replace(',)', ')'))

            context = fts3.Context(endpoint, proxyPath)
            status = 'wait'  # This status leaves the jobs queued. The only alternative is "cancel"

            pausedJobIDs = fts3.ban_se(context,
                                       storageElement,
                                       status,
                                       timeout=3600,
                                       allow_submit=False)
            self.log.info("fts3.ban_se: paused jobs: %s" %
                          ','.join(pausedJobIDs))

            blacklist[endpoint] = json.loads(context.get("ban/se"))

        return S_OK(blacklist)