Example #1
0
File: PEP.py Project: closier/DIRAC
  def __init__(self, VOExtension, granularity = None, name = None, status = None, formerStatus = None,
               reason = None, siteType = None, serviceType = None, resourceType = None,
               tokenOwner = None, useNewRes = False):

    self.VOExtension = VOExtension

    try:
      self.__granularity = assignOrRaise(granularity, ValidRes, InvalidRes, self, self.__init__)
    except NameError:
      pass

    self.__name         = name
    self.__status       = assignOrRaise(status, ValidStatus, InvalidStatus, self, self.__init__)
    self.__formerStatus = assignOrRaise(formerStatus, ValidStatus, InvalidStatus, self, self.__init__)
    self.__reason       = reason
    self.__siteType     = assignOrRaise(siteType, ValidSiteType, InvalidSiteType, self, self.__init__)
    self.__serviceType  = assignOrRaise(serviceType, ValidServiceType, InvalidServiceType, self, self.__init__)
    self.__resourceType = assignOrRaise(resourceType, ValidResourceType, InvalidResourceType, self, self.__init__)

    self.__realBan = False
    if tokenOwner is not None:
      if tokenOwner == 'RS_SVC':
        self.__realBan = True

    self.useNewRes = useNewRes
Example #2
0
  def __init__(self, VOExtension, granularity = None, name = None, status = None, formerStatus = None,
               reason = None, siteType = None, serviceType = None, resourceType = None,
               useNewRes = False):
    """
    PDP (Policy Decision Point) initialization

    :params:
      :attr:`VOExtension`: string - VO extension (e.g. 'LHCb')

      :attr:`granularity`: string - a ValidRes

      :attr:`name`: string - name (e.g. of a site)

      :attr:`status`: string - status

      :attr:`formerStatus`: string - former status

      :attr:`reason`: string - optional reason for last status change

      :attr:`siteType`: string - optional site type

      :attr:`serviceType`: string - optional service type

      :attr:`resourceType`: string - optional resource type
    """

    self.VOExtension = VOExtension

    self.__granularity  = assignOrRaise(granularity, ValidRes, InvalidRes, self, self.__init__)
    self.__name         = name
    self.__status       = assignOrRaise(status, ValidStatus, InvalidStatus, self, self.__init__)
    self.__formerStatus = assignOrRaise(formerStatus, ValidStatus, InvalidStatus, self, self.__init__)
    self.__reason       = reason
    self.__siteType     = assignOrRaise(siteType, ValidSiteType, InvalidSiteType, self, self.__init__)
    self.__serviceType  = assignOrRaise(serviceType, ValidServiceType, InvalidServiceType, self, self.__init__)
    self.__resourceType = assignOrRaise(resourceType, ValidResourceType, InvalidResourceType, self, self.__init__)

    cc      = CommandCaller()
    self.pc = PolicyCaller(cc)

    self.useNewRes = useNewRes

    self.args      = None
    self.policy    = None
    self.knownInfo = None
    self.ig        = None
Example #3
0
File: PEP.py Project: vfalbor/DIRAC
  def __init__(self, VOExtension, granularity = None, name = None, status = None, formerStatus = None,
               reason = None, siteType = None, serviceType = None, resourceType = None,
               tokenOwner = None, #futureEnforcement = None,
               useNewRes = False):

    self.VOExtension = VOExtension

    try:
#      granularity = presentEnforcement['Granularity']
      self.__granularity = assignOrRaise(granularity, ValidRes, InvalidRes, self, self.__init__)
    except NameError:
      pass

    self.__name         = name
    self.__status       = assignOrRaise(status, ValidStatus, InvalidStatus, self, self.__init__)
    self.__formerStatus = assignOrRaise(formerStatus, ValidStatus, InvalidStatus, self, self.__init__)
    self.__reason       = reason
    self.__siteType     = assignOrRaise(siteType, ValidSiteType, InvalidSiteType, self, self.__init__)
    self.__serviceType  = assignOrRaise(serviceType, ValidServiceType, InvalidServiceType, self, self.__init__)
    self.__resourceType = assignOrRaise(resourceType, ValidResourceType, InvalidResourceType, self, self.__init__)

    self.__realBan = False
    if tokenOwner is not None:
      if tokenOwner == 'RS_SVC':
        self.__realBan = True

#    if futureEnforcement is not None:
#      try:
#        futureGranularity = futureEnforcement['Granularity']
#        if futureGranularity is not None:
#          if futureGranularity not in ValidRes:
#            raise InvalidRes, where(self, self.__init__)
#        self.__futureGranularity = futureGranularity
#      except NameError:
#        pass

    self.useNewRes = useNewRes

    configModule = __import__(self.VOExtension+"DIRAC.ResourceStatusSystem.Policy.Configurations",
                              globals(), locals(), ['*'])

    self.AssigneeGroups = copy.deepcopy(configModule.AssigneeGroups)
Example #4
0
    def __init__(self,
                 VOExtension,
                 granularity=None,
                 name=None,
                 status=None,
                 formerStatus=None,
                 reason=None,
                 siteType=None,
                 serviceType=None,
                 resourceType=None,
                 useNewRes=False):
        """
    PDP (Policy Decision Point) initialization

    :params:
      :attr:`VOExtension`: string - VO extension (e.g. 'LHCb')

      :attr:`granularity`: string - a ValidRes

      :attr:`name`: string - name (e.g. of a site)

      :attr:`status`: string - status

      :attr:`formerStatus`: string - former status

      :attr:`reason`: string - optional reason for last status change

      :attr:`siteType`: string - optional site type

      :attr:`serviceType`: string - optional service type

      :attr:`resourceType`: string - optional resource type
    """

        self.VOExtension = VOExtension

        self.__granularity = assignOrRaise(granularity, ValidRes, InvalidRes,
                                           self, self.__init__)
        self.__name = name
        self.__status = assignOrRaise(status, ValidStatus, InvalidStatus, self,
                                      self.__init__)
        self.__formerStatus = assignOrRaise(formerStatus, ValidStatus,
                                            InvalidStatus, self, self.__init__)
        self.__reason = reason
        self.__siteType = assignOrRaise(siteType, ValidSiteType,
                                        InvalidSiteType, self, self.__init__)
        self.__serviceType = assignOrRaise(serviceType, ValidServiceType,
                                           InvalidServiceType, self,
                                           self.__init__)
        self.__resourceType = assignOrRaise(resourceType, ValidResourceType,
                                            InvalidResourceType, self,
                                            self.__init__)

        cc = CommandCaller()
        self.pc = PolicyCaller(cc)

        self.useNewRes = useNewRes

        self.args = None
        self.policy = None
        self.knownInfo = None
        self.ig = None