Revision 082a7f91

b/lib/backend.py
292 292
        connectivity with
293 293
      - hypervisor: list with hypervisors to run the verify for
294 294

  
295

  
296 295
  """
297 296
  result = {}
298 297

  
......
1169 1168
  try:
1170 1169
    f = open(api_file)
1171 1170
    try:
1172
      api_version = f.read(256)
1171
      api_versions = f.readlines()
1173 1172
    finally:
1174 1173
      f.close()
1175 1174
  except EnvironmentError, err:
1176 1175
    raise errors.InvalidOS(name, os_dir, "error while reading the"
1177 1176
                           " API version (%s)" % _ErrnoOrStr(err))
1178 1177

  
1179
  api_version = api_version.strip()
1178
  api_versions = [version.strip() for version in api_versions]
1180 1179
  try:
1181
    api_version = int(api_version)
1180
    api_versions = [int(version) for version in api_versions]
1182 1181
  except (TypeError, ValueError), err:
1183 1182
    raise errors.InvalidOS(name, os_dir,
1184 1183
                           "API version is not integer (%s)" % str(err))
1185 1184

  
1186
  return api_version
1185
  return api_versions
1187 1186

  
1188 1187

  
1189 1188
def DiagnoseOS(top_dirs=None):
......
1238 1237
  else:
1239 1238
    os_dir = os.path.sep.join([base_dir, name])
1240 1239

  
1241
  api_version = _OSOndiskVersion(name, os_dir)
1240
  api_versions = _OSOndiskVersion(name, os_dir)
1242 1241

  
1243
  if api_version != constants.OS_API_VERSION:
1242
  if constants.OS_API_VERSION not in api_versions:
1244 1243
    raise errors.InvalidOS(name, os_dir, "API version mismatch"
1245 1244
                           " (found %s want %s)"
1246
                           % (api_version, constants.OS_API_VERSION))
1245
                           % (api_versions, constants.OS_API_VERSION))
1247 1246

  
1248 1247
  # OS Scripts dictionary, we will populate it with the actual script names
1249 1248
  os_scripts = {'create': '', 'export': '', 'import': '', 'rename': ''}
......
1271 1270
                    export_script=os_scripts['export'],
1272 1271
                    import_script=os_scripts['import'],
1273 1272
                    rename_script=os_scripts['rename'],
1274
                    api_version=api_version)
1273
                    api_versions=api_versions)
1275 1274

  
1276 1275

  
1277 1276
def GrowBlockDevice(disk, amount):
b/lib/objects.py
649 649
    "name",
650 650
    "path",
651 651
    "status",
652
    "api_version",
652
    "api_versions",
653 653
    "create_script",
654 654
    "export_script",
655 655
    "import_script",

Also available in: Unified diff