DowntimeCommand

DowntimeCommand module will look into GOC DB to find announced downtimes for RSS-managed sites and resources. If found, downtimes are added to the internal RSS cache using ResourceManagementClient.

GOCDB downtimes that are modified or deleted are also synced.

class DIRAC.ResourceStatusSystem.Command.DowntimeCommand.DowntimeCommand(args=None, clients=None)

Bases: Command

Downtime “master” Command or removed DTs.

__init__(args=None, clients=None)
doCache()

Method that reads the cache table and tries to read from it. It will return a list with one dictionary describing the DT if there are results.

doCommand()

Real commands don’t need to extende/replace this method, which is called by clients.

What is done here is the following: if self.masterMode is set to True, then the “doMaster()” method is called. if not, then the doCache() method is called, and if this returns an object this is returned, and otherwise the “doNew” method is called.

doMaster()

Master method, which looks little bit spaghetti code, sorry ! - It gets all sites and transforms them into gocSites. - It gets all the storage elements and transforms them into their hosts - It gets the the CEs (FTS and file catalogs will come).

doNew(masterParams=None)

Gets the parameters to run, either from the master method or from its own arguments.

For every elementName, unless it is given a list, in which case it contacts the gocdb client. The server is not very stable, so in case of failure tries a second time.

If there are downtimes, are recorded and then returned.

returnERROR(s_obj)

Overwrites S_ERROR message with command name, much easier to debug

returnSObj(s_obj)

Overwrites S_ERROR message with command name, much easier to debug