Revision c87997d2

b/lib/constants.py
32 32

  
33 33
# various versions
34 34
RELEASE_VERSION = _constants.RELEASE_VERSION
35
OS_API_V10 = 10
36
OS_API_V15 = 15
37
OS_API_V20 = 20
38
OS_API_VERSIONS = compat.UniqueFrozenset([
39
  OS_API_V10,
40
  OS_API_V15,
41
  OS_API_V20,
42
  ])
35
OS_API_V10 = _constants.OS_API_V10
36
OS_API_V15 = _constants.OS_API_V15
37
OS_API_V20 = _constants.OS_API_V20
38
OS_API_VERSIONS = _constants.OS_API_VERSIONS
43 39
VCS_VERSION = _vcsversion.VCS_VERSION
44 40
EXPORT_VERSION = 0
45 41
RAPI_VERSION = 2
b/src/Ganeti/HsConstants.hs
139 139
dirVersion :: String
140 140
dirVersion = AutoConf.dirVersion
141 141

  
142
osApiV10 :: Int
143
osApiV10 = 10
144

  
145
osApiV15 :: Int
146
osApiV15 = 15
147

  
148
osApiV20 :: Int
149
osApiV20 = 20
150

  
151
osApiVersions :: FrozenSet Int
152
osApiVersions = ConstantUtils.mkSet [osApiV10, osApiV15, osApiV20]
153

  
142 154
configMajor :: Int
143 155
configMajor = AutoConf.versionMajor
144 156

  
b/src/Ganeti/Query/Server.hs
36 36
import Control.Exception
37 37
import Control.Monad (forever)
38 38
import Data.Bits (bitSize)
39
import qualified Data.Set as Set (toList)
39 40
import Data.IORef
40 41
import qualified Network.Socket as S
41 42
import qualified Text.JSON as J
......
43 44
import System.Info (arch)
44 45

  
45 46
import qualified Ganeti.Constants as C
47
import qualified Ganeti.ConstantUtils as ConstantUtils (unFrozenSet)
46 48
import Ganeti.Errors
47 49
import qualified Ganeti.Path as Path
48 50
import Ganeti.Daemon
......
96 98
      obj = [ ("software_version", showJSON C.releaseVersion)
97 99
            , ("protocol_version", showJSON C.protocolVersion)
98 100
            , ("config_version", showJSON C.configVersion)
99
            , ("os_api_version", showJSON $ maximum C.osApiVersions)
101
            , ("os_api_version", showJSON . maximum .
102
                                 Set.toList . ConstantUtils.unFrozenSet $
103
                                 C.osApiVersions)
100 104
            , ("export_version", showJSON C.exportVersion)
101 105
            , ("vcs_version", showJSON C.vcsVersion)
102 106
            , ("architecture", showJSON arch_tuple)

Also available in: Unified diff