Revision ff6c5e55 lib/cmdlib.py

b/lib/cmdlib.py
740 740
                                       use_none=use_none,
741 741
                                       use_default=use_default)
742 742
    else:
743
      # FIXME: we assume all others are lists; this should be redone
744
      # in a nicer way
745 743
      if not value or value == [constants.VALUE_DEFAULT]:
746 744
        if group_policy:
747 745
          del ipolicy[key]
......
750 748
                                     " on the cluster'" % key,
751 749
                                     errors.ECODE_INVAL)
752 750
      else:
753
        ipolicy[key] = list(value)
751
        if key in constants.IPOLICY_PARAMETERS:
752
          # FIXME: we assume all such values are float
753
          try:
754
            ipolicy[key] = float(value)
755
          except (TypeError, ValueError), err:
756
            raise errors.OpPrereqError("Invalid value for attribute"
757
                                       " '%s': '%s', error: %s" %
758
                                       (key, value, err), errors.ECODE_INVAL)
759
        else:
760
          # FIXME: we assume all others are lists; this should be redone
761
          # in a nicer way
762
          ipolicy[key] = list(value)
754 763
  try:
755 764
    objects.InstancePolicy.CheckParameterSyntax(ipolicy)
756 765
  except errors.ConfigurationError, err:

Also available in: Unified diff