Rename IPOLICY_PARAMETERS to IPOLICY_ISPECS
authorIustin Pop <iustin@google.com>
Mon, 23 Jan 2012 14:41:55 +0000 (15:41 +0100)
committerIustin Pop <iustin@google.com>
Thu, 26 Jan 2012 11:47:07 +0000 (12:47 +0100)
As opposed to the initial situation, the PARAMETERS will be more than
just the min/std/max ispecs. Let's rename it, before re-adding the
PARAMETERS constant with a different meaning.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

lib/client/gnt_cluster.py
lib/cmdlib.py
lib/config.py
lib/constants.py
lib/objects.py

index 2fa42cd..1fc0cf8 100644 (file)
@@ -463,7 +463,7 @@ def ShowClusterConfig(opts, args):
   _PrintGroupedParams(result["nicparams"], roman=opts.roman_integers)
 
   ToStdout("Instance policy - limits for instances:")
-  for key in constants.IPOLICY_PARAMETERS:
+  for key in constants.IPOLICY_ISPECS:
     ToStdout("  - %s", key)
     _PrintGroupedParams(result["ipolicy"][key], roman=opts.roman_integers)
   ToStdout("  - enabled disk templates: %s",
index e1df414..46bf7ee 100644 (file)
@@ -734,7 +734,7 @@ def _GetUpdatedIPolicy(old_ipolicy, new_ipolicy, group_policy=False):
     if key not in constants.IPOLICY_ALL_KEYS:
       raise errors.OpPrereqError("Invalid key in new ipolicy: %s" % key,
                                  errors.ECODE_INVAL)
-    if key in constants.IPOLICY_PARAMETERS:
+    if key in constants.IPOLICY_ISPECS:
       utils.ForceDictType(value, constants.ISPECS_PARAMETER_TYPES)
       ipolicy[key] = _GetUpdatedParams(old_ipolicy.get(key, {}), value,
                                        use_none=use_none,
index 7654ba1..a4f864d 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -434,7 +434,7 @@ class ConfigWriter:
 
     def _helper_ispecs(owner, params):
       for key, value in params.items():
-        if key in constants.IPOLICY_PARAMETERS:
+        if key in constants.IPOLICY_ISPECS:
           fullkey = "ipolicy/" + key
           _helper(owner, fullkey, value, constants.ISPECS_PARAMETER_TYPES)
         else:
index b38039a..b2cdfec 100644 (file)
@@ -951,12 +951,12 @@ ISPECS_MAX = "max"
 ISPECS_STD = "std"
 IPOLICY_DTS = "disk_templates"
 
-IPOLICY_PARAMETERS = frozenset([
+IPOLICY_ISPECS = frozenset([
   ISPECS_MIN,
   ISPECS_MAX,
   ISPECS_STD,
   ])
-IPOLICY_ALL_KEYS = IPOLICY_PARAMETERS.union([IPOLICY_DTS])
+IPOLICY_ALL_KEYS = IPOLICY_ISPECS.union([IPOLICY_DTS])
 
 # Node parameter names
 ND_OOB_PROGRAM = "oob_program"
index 8003b4a..96c5440 100644 (file)
@@ -98,7 +98,7 @@ def FillIPolicy(default_ipolicy, custom_ipolicy, skip_keys=None):
   """
   assert frozenset(default_ipolicy.keys()) == constants.IPOLICY_ALL_KEYS
   ret_dict = {}
-  for key in constants.IPOLICY_PARAMETERS:
+  for key in constants.IPOLICY_ISPECS:
     ret_dict[key] = FillDict(default_ipolicy[key],
                              custom_ipolicy.get(key, {}),
                              skip_keys=skip_keys)