Пример #1
0
def callClient(args, clientIn = None):

  if clientIn is not None:
    c = clientIn
  else:
    # use standard GGUSTickets Client
    from DIRAC.Core.LCG.GGUSTicketsClient import GGUSTicketsClient   
    c = GGUSTicketsClient()
    
  name = args[1]
  
  name = getGOCSiteName(name)
  if not name['OK']:
    raise RSSException, name['Message']
  name = name['Value']
  
  try:
    openTickets = c.getTicketsList(name)
    if not openTickets['OK']:
      return 'Unknown'
    return openTickets['Value']
  except urllib2.URLError:
    gLogger.error("GGUSTicketsClient timed out for " + name)
    return 'Unknown'
  except:
    gLogger.exception("Exception when calling GGUSTicketsClient for " + name)
    return 'Unknown'
Пример #2
0
    def setUp(self):

        self.mockRSS = mock.MagicMock()

        self.GOCCli = GOCDBClient()
        #     self.SAMCli = SAMResultsClient()
        self.GGUSCli = GGUSTicketsClient()
Пример #3
0
    def setUp(self):

        from DIRAC.Core.Base.Script import parseCommandLine
        parseCommandLine()

        self.mockRSS = Mock()

        self.GOCCli = GOCDBClient()
        self.SLSCli = SLSClient()
        self.SAMCli = SAMResultsClient()
        self.GGUSCli = GGUSTicketsClient()
Пример #4
0
    def __init__(self, args=None, clients=None):

        super(GGUSTicketsCommand, self).__init__(args, clients)

        if 'GGUSTicketsClient' in self.apis:
            self.gClient = self.apis['GGUSTicketsClient']
        else:
            self.gClient = GGUSTicketsClient()

        if 'ResourceManagementClient' in self.apis:
            self.rmClient = self.apis['ResourceManagementClient']
        else:
            self.rmClient = ResourceManagementClient()