Revision c478f837 htools/Ganeti/HTools/ExtLoader.hs
b/htools/Ganeti/HTools/ExtLoader.hs | ||
---|---|---|
1 |
{-# LANGUAGE CPP #-} |
|
2 |
|
|
3 | 1 |
{-| External data loader |
4 | 2 |
|
5 | 3 |
This module holds the external data loading, and thus is the only one |
... | ... | |
10 | 8 |
|
11 | 9 |
{- |
12 | 10 |
|
13 |
Copyright (C) 2009, 2010 Google Inc. |
|
11 |
Copyright (C) 2009, 2010, 2011 Google Inc.
|
|
14 | 12 |
|
15 | 13 |
This program is free software; you can redistribute it and/or modify |
16 | 14 |
it under the terms of the GNU General Public License as published by |
... | ... | |
43 | 41 |
import Text.Printf (printf, hPrintf) |
44 | 42 |
|
45 | 43 |
import qualified Ganeti.HTools.Luxi as Luxi |
46 |
#ifndef NO_CURL |
|
47 | 44 |
import qualified Ganeti.HTools.Rapi as Rapi |
48 |
#endif |
|
49 | 45 |
import qualified Ganeti.HTools.Simu as Simu |
50 | 46 |
import qualified Ganeti.HTools.Text as Text |
51 | 47 |
import Ganeti.HTools.Loader (mergeData, checkData, ClusterData(..) |
... | ... | |
109 | 105 |
exitWith $ ExitFailure 1) |
110 | 106 |
input_data <- |
111 | 107 |
case () of |
112 |
_ | setRapi -> |
|
113 |
#ifdef NO_CURL |
|
114 |
return $ Bad "RAPI/curl backend disabled at compile time" |
|
115 |
#else |
|
116 |
wrapIO $ Rapi.loadData mhost |
|
117 |
#endif |
|
108 |
_ | setRapi -> wrapIO $ Rapi.loadData mhost |
|
118 | 109 |
| setLuxi -> wrapIO $ Luxi.loadData $ fromJust lsock |
119 | 110 |
| setSim -> Simu.loadData simdata |
120 | 111 |
| setFile -> wrapIO $ Text.loadData $ fromJust tfile |
Also available in: Unified diff