Commit 517490d7 authored by Klaus Aehlig's avatar Klaus Aehlig

Add an RPC to get the list of current maintenance jobs

...so that the maintenance daemon can always access the authoritative
version of that list.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 7cb24ae9
......@@ -62,9 +62,10 @@ import Ganeti.Locking.Locks ( GanetiLocks(ConfigLock, BGL)
, ClientType(ClientOther), ClientId(..) )
import qualified Ganeti.Locking.Waiting as LW
import Ganeti.Objects ( ConfigData, DRBDSecret, LogicalVolume, Ip4Address
, configMaintenance, maintRoundDelay
, configMaintenance, maintRoundDelay, maintJobs
)
import Ganeti.Objects.Lens (configClusterL, clusterMasterNodeL)
import Ganeti.Types (JobId)
import Ganeti.WConfd.ConfigState (csConfigDataL)
import qualified Ganeti.WConfd.ConfigVerify as V
import Ganeti.WConfd.DeathDetection (cleanupLocks)
......@@ -163,6 +164,10 @@ maintenanceRoundDelay :: WConfdMonad Int
maintenanceRoundDelay = liftM ( maintRoundDelay . configMaintenance )
CW.readConfig
-- | Get the list of jobs in the state of the maintenance daemon.
maintenanceJobs :: WConfdMonad [JobId]
maintenanceJobs = liftM ( maintJobs . configMaintenance ) CW.readConfig
-- ** Temporary reservations related functions
dropAllReservations :: ClientId -> WConfdMonad ()
......@@ -394,6 +399,7 @@ exportedFunctions = [ 'echo
, 'writeConfigAndUnlock
, 'flushConfig
, 'maintenanceRoundDelay
, 'maintenanceJobs
-- temporary reservations (common)
, 'dropAllReservations
-- DRBD
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment