[Pkg-ganeti-devel] [ganeti] 62/165: Make ExtLoader honor --exit-on-missing-mond-data
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Tue Aug 11 13:53:13 UTC 2015
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch master
in repository ganeti.
commit 266b72b6c03513974eda9e86309d586f5fd2f414
Author: Klaus Aehlig <aehlig at google.com>
Date: Mon Mar 2 12:10:54 2015 +0100
Make ExtLoader honor --exit-on-missing-mond-data
If this option is given, make loadExternalData evaluate the bit indicating
if all data was available. If this is not the case, exit.
Signed-off-by: Klaus Aehlig <aehlig at google.com>
Reviewed-by: Petr Pudlak <pudlak at google.com>
---
src/Ganeti/HTools/ExtLoader.hs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/Ganeti/HTools/ExtLoader.hs b/src/Ganeti/HTools/ExtLoader.hs
index aebaeb3..56e2e80 100644
--- a/src/Ganeti/HTools/ExtLoader.hs
+++ b/src/Ganeti/HTools/ExtLoader.hs
@@ -46,6 +46,7 @@ import Control.Monad
import Control.Monad.Writer (runWriterT)
import Control.Exception
import Data.Maybe (isJust, fromJust)
+import Data.Monoid (getAll)
import System.FilePath
import System.IO
import System.Time (getClockTime)
@@ -125,9 +126,11 @@ loadExternalData opts = do
ldresult = input_data >>= (if ignoreDynU then clearDynU else return)
>>= mergeData eff_u exTags selInsts exInsts now
cdata <- exitIfBad "failed to load data, aborting" ldresult
- (cdata', _) <- runWriterT $ if optMonD opts
- then MonD.queryAllMonDDCs cdata opts
- else return cdata
+ (cdata', ok) <- runWriterT $ if optMonD opts
+ then MonD.queryAllMonDDCs cdata opts
+ else return cdata
+ exitWhen (optMonDExitMissing opts && not (getAll ok))
+ "Not all required data available"
let (fix_msgs, nl) = checkData (cdNodes cdata') (cdInstances cdata')
unless (optVerbose opts == 0) $ maybeShowWarnings fix_msgs
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git
More information about the Pkg-ganeti-devel
mailing list