GOCDBSyncCommand

GOCDBSyncCommand module

This command updates the downtime dates from the DowntimeCache table in case they changed after being fetched from GOCDB. In other words, it ensures that all the downtime dates in the database are current.

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

Bases: Command

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

To be extended/replaced by real commands

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()

This method calls the doNew method for each hostname that exists in the DowntimeCache table of the local database.

Returns

S_OK / S_ERROR

doNew(masterParams=None)

Gets the downtime IDs and dates of a given hostname from the local database and compares the results with the remote database of GOCDB. If the downtime dates have been changed it updates the local database.

Param

masterParams - string

Returns

S_OK / S_ERROR

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