Fix setting ipolicy on node groups
authorRené Nussbaumer <rn@google.com>
Thu, 19 Jul 2012 08:26:13 +0000 (10:26 +0200)
committerRené Nussbaumer <rn@google.com>
Thu, 19 Jul 2012 12:15:48 +0000 (14:15 +0200)
commit8b05721832e29eb47f40a393527e1eab7c1e7e21
tree4c971a1a99bca701e51e49a973fd62b4d4f86ab7
parent2da311813cfe994ff232052fe9637633e98ea395
Fix setting ipolicy on node groups

On node groups we don't have the std field. However, the InstancePolicy
object always verifies that the std value is within a given range. As we
fill it up with defaults if not set (as it happens to be on node groups)
and the min value is higher than the default std value (taken from
constants.py) we fail.

We overcome this situation by simply let the function know if we want to
verify the std value at all. If we don't want to verify std, we just set
it to a compliant value (min_v) and continue.

We also slightly adapt the error message provided, as we don't have std
values on groups.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
lib/cmdlib.py
lib/config.py
lib/objects.py