Revision b2e233a5

b/lib/bootstrap.py
410 410
  dirs = [(constants.RUN_GANETI_DIR, constants.RUN_DIRS_MODE)]
411 411
  utils.EnsureDirs(dirs)
412 412

  
413
  objects.UpgradeBeParams(beparams)
413 414
  utils.ForceDictType(beparams, constants.BES_PARAMETER_TYPES)
414 415
  utils.ForceDictType(nicparams, constants.NICS_PARAMETER_TYPES)
415 416
  objects.NIC.CheckParameterSyntax(nicparams)
b/lib/cli.py
2212 2212
  else:
2213 2213
    tags = []
2214 2214

  
2215
  utils.ForceDictType(opts.beparams, constants.BES_PARAMETER_TYPES)
2215
  utils.ForceDictType(opts.beparams, constants.BES_PARAMETER_COMPAT)
2216 2216
  utils.ForceDictType(hvparams, constants.HVS_PARAMETER_TYPES)
2217 2217

  
2218 2218
  if mode == constants.INSTANCE_CREATE:
b/lib/client/gnt_cluster.py
100 100

  
101 101
  # prepare beparams dict
102 102
  beparams = objects.FillDict(constants.BEC_DEFAULTS, beparams)
103
  utils.ForceDictType(beparams, constants.BES_PARAMETER_TYPES)
103
  utils.ForceDictType(beparams, constants.BES_PARAMETER_COMPAT)
104 104

  
105 105
  # prepare nicparams dict
106 106
  nicparams = objects.FillDict(constants.NICC_DEFAULTS, nicparams)
......
917 917
    utils.ForceDictType(hv_params, constants.HVS_PARAMETER_TYPES)
918 918

  
919 919
  beparams = opts.beparams
920
  utils.ForceDictType(beparams, constants.BES_PARAMETER_TYPES)
920
  utils.ForceDictType(beparams, constants.BES_PARAMETER_COMPAT)
921 921

  
922 922
  nicparams = opts.nicparams
923 923
  utils.ForceDictType(nicparams, constants.NICS_PARAMETER_TYPES)
b/lib/client/gnt_instance.py
357 357
                                   (elem, name, err), errors.ECODE_INVAL)
358 358
      disks.append({"size": size})
359 359

  
360
    utils.ForceDictType(specs["backend"], constants.BES_PARAMETER_TYPES)
360
    utils.ForceDictType(specs["backend"], constants.BES_PARAMETER_COMPAT)
361 361
    utils.ForceDictType(hvparams, constants.HVS_PARAMETER_TYPES)
362 362

  
363 363
    tmp_nics = []
......
1266 1266
      if opts.beparams[param].lower() == "default":
1267 1267
        opts.beparams[param] = constants.VALUE_DEFAULT
1268 1268

  
1269
  utils.ForceDictType(opts.beparams, constants.BES_PARAMETER_TYPES,
1269
  utils.ForceDictType(opts.beparams, constants.BES_PARAMETER_COMPAT,
1270 1270
                      allowed_values=[constants.VALUE_DEFAULT])
1271 1271

  
1272 1272
  for param in opts.hvparams:
b/lib/cmdlib.py
3563 3563
    self.cluster = cluster = self.cfg.GetClusterInfo()
3564 3564
    # validate params changes
3565 3565
    if self.op.beparams:
3566
      objects.UpgradeBeParams(self.op.beparams)
3566 3567
      utils.ForceDictType(self.op.beparams, constants.BES_PARAMETER_TYPES)
3567 3568
      self.new_beparams = cluster.SimpleFillBE(self.op.beparams)
3568 3569

  
......
6132 6133
    # extra beparams
6133 6134
    if self.op.beparams:
6134 6135
      # fill the beparams dict
6136
      objects.UpgradeBeParams(self.op.beparams)
6135 6137
      utils.ForceDictType(self.op.beparams, constants.BES_PARAMETER_TYPES)
6136 6138

  
6137 6139
  def ExpandNames(self):
......
8979 8981
    for param, value in self.op.beparams.iteritems():
8980 8982
      if value == constants.VALUE_AUTO:
8981 8983
        self.op.beparams[param] = default_beparams[param]
8984
    objects.UpgradeBeParams(self.op.beparams)
8982 8985
    utils.ForceDictType(self.op.beparams, constants.BES_PARAMETER_TYPES)
8983 8986
    self.be_full = cluster.SimpleFillBE(self.op.beparams)
8984 8987

  
......
11281 11284
    if self.op.beparams:
11282 11285
      i_bedict = _GetUpdatedParams(instance.beparams, self.op.beparams,
11283 11286
                                   use_none=True)
11287
      objects.UpgradeBeParams(i_bedict)
11284 11288
      utils.ForceDictType(i_bedict, constants.BES_PARAMETER_TYPES)
11285 11289
      be_new = cluster.SimpleFillBE(i_bedict)
11286 11290
      self.be_proposed = self.be_new = be_new # the new actual values
b/lib/constants.py
867 867
BE_AUTO_BALANCE = "auto_balance"
868 868

  
869 869
BES_PARAMETER_TYPES = {
870
    BE_MEMORY: VTYPE_SIZE,
871 870
    BE_MAXMEM: VTYPE_SIZE,
872 871
    BE_MINMEM: VTYPE_SIZE,
873 872
    BE_VCPUS: VTYPE_INT,
874 873
    BE_AUTO_BALANCE: VTYPE_BOOL,
875 874
    }
876 875

  
876
BES_PARAMETER_COMPAT = {
877
  BE_MEMORY: VTYPE_SIZE,
878
  }
879
BES_PARAMETER_COMPAT.update(BES_PARAMETER_TYPES)
880

  
877 881
BES_PARAMETERS = frozenset(BES_PARAMETER_TYPES.keys())
878 882

  
879 883
# Node parameter names
......
1627 1631
  ])
1628 1632

  
1629 1633
BEC_DEFAULTS = {
1630
  BE_MEMORY: 128,
1631 1634
  BE_MINMEM: 128,
1632 1635
  BE_MAXMEM: 128,
1633 1636
  BE_VCPUS: 1,
b/lib/objects.py
107 107
    memory = target[constants.BE_MEMORY]
108 108
    target[constants.BE_MAXMEM] = memory
109 109
    target[constants.BE_MINMEM] = memory
110
    #FIXME(dynmem): delete old value
111
    #del target[constants.BE_MEMORY]
110
    del target[constants.BE_MEMORY]
112 111

  
113 112

  
114 113
class ConfigObject(object):

Also available in: Unified diff