The diagnose status collector gets the name of the diagnose program from the configuration. (Of course, independent white-listing by the node is checked afterwards.) The standard way for MonD to access the configuration is by asking the ConfDs; this is necessary, as MonD is present on any node, but the configuration only on the master node. Do this.
Signed-off-by: Klaus Aehlig <[email protected]> --- src/Ganeti/DataCollectors/Diagnose.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Ganeti/DataCollectors/Diagnose.hs b/src/Ganeti/DataCollectors/Diagnose.hs index 14e05ec..aaa5ac4 100644 --- a/src/Ganeti/DataCollectors/Diagnose.hs +++ b/src/Ganeti/DataCollectors/Diagnose.hs @@ -61,7 +61,7 @@ import System.Process (readProcess) import Text.JSON (JSValue(..), toJSObject, toJSString, decode, Result(..)) import Ganeti.BasicTypes (runResultT, ResultT(..), genericResult) -import Ganeti.Config (loadConfig) +import Ganeti.Confd.ClientFunctions (getDiagnoseCollectorFilename) import Ganeti.Constants (dataCollectorDiagnose, dataCollectorDiagnoseDirectory) import Ganeti.DataCollectors.Types ( DCCategory(..) , DCKind(..) @@ -69,8 +69,6 @@ import Ganeti.DataCollectors.Types ( DCCategory(..) , DCReport(..) , buildReport ) -import Ganeti.Objects (configCluster, clusterDiagnoseDataCollectorFilename) -import Ganeti.Path (clusterConfFile) -- | The name of this data collector. dcName :: String @@ -150,9 +148,8 @@ fnToVal fn buildJsonReport :: IO JSValue buildJsonReport = fmap (genericResult okWithDetails id) . runResultT $ do - configData <- ResultT (clusterConfFile >>= loadConfig) - lift . fnToVal . clusterDiagnoseDataCollectorFilename $ - configCluster configData + statusFnName <- getDiagnoseCollectorFilename Nothing Nothing + lift $ fnToVal statusFnName -- | The data exported by the data collector, taken from the default location. dcReport :: IO DCReport -- 2.7.0.rc3.207.g0ac5344
