Change BEGR_DEFAULT to PP_DEFAULT
authorGuido Trotter <ultrotter@google.com>
Mon, 8 Jun 2009 09:58:59 +0000 (10:58 +0100)
committerGuido Trotter <ultrotter@google.com>
Mon, 8 Jun 2009 16:58:32 +0000 (17:58 +0100)
This way the same constant can represent the default profile also for
nic, disk and OS parameters.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/bootstrap.py
lib/cmdlib.py
lib/constants.py
lib/objects.py
tools/cfgupgrade

index 6447369..d1cddfa 100644 (file)
@@ -247,7 +247,7 @@ def InitCluster(cluster_name, mac_prefix, def_bridge,
     file_storage_dir=file_storage_dir,
     enabled_hypervisors=enabled_hypervisors,
     default_hypervisor=default_hypervisor,
-    beparams={constants.BEGR_DEFAULT: beparams},
+    beparams={constants.PP_DEFAULT: beparams},
     hvparams=hvparams,
     candidate_pool_size=candidate_pool_size,
     modify_etc_hosts=modify_etc_hosts,
index a4dd071..1dbd2d1 100644 (file)
@@ -1490,7 +1490,7 @@ class LUSetClusterParams(LogicalUnit):
     if self.op.beparams:
       utils.ForceDictType(self.op.beparams, constants.BES_PARAMETER_TYPES)
       self.new_beparams = objects.FillDict(
-        cluster.beparams[constants.BEGR_DEFAULT], self.op.beparams)
+        cluster.beparams[constants.PP_DEFAULT], self.op.beparams)
 
     # hypervisor list/parameters
     self.new_hvparams = objects.FillDict(cluster.hvparams, {})
@@ -1538,7 +1538,7 @@ class LUSetClusterParams(LogicalUnit):
     if self.op.enabled_hypervisors is not None:
       self.cluster.enabled_hypervisors = self.op.enabled_hypervisors
     if self.op.beparams:
-      self.cluster.beparams[constants.BEGR_DEFAULT] = self.new_beparams
+      self.cluster.beparams[constants.PP_DEFAULT] = self.new_beparams
     if self.op.candidate_pool_size is not None:
       self.cluster.candidate_pool_size = self.op.candidate_pool_size
 
@@ -4411,7 +4411,7 @@ class LUCreateInstance(LogicalUnit):
 
     # fill and remember the beparams dict
     utils.ForceDictType(self.op.beparams, constants.BES_PARAMETER_TYPES)
-    self.be_full = objects.FillDict(cluster.beparams[constants.BEGR_DEFAULT],
+    self.be_full = objects.FillDict(cluster.beparams[constants.PP_DEFAULT],
                                     self.op.beparams)
 
     #### instance parameters check
@@ -5987,7 +5987,7 @@ class LUSetInstanceParams(LogicalUnit):
           i_bedict[key] = val
       cluster = self.cfg.GetClusterInfo()
       utils.ForceDictType(i_bedict, constants.BES_PARAMETER_TYPES)
-      be_new = objects.FillDict(cluster.beparams[constants.BEGR_DEFAULT],
+      be_new = objects.FillDict(cluster.beparams[constants.PP_DEFAULT],
                                 i_bedict)
       self.be_new = be_new # the new actual values
       self.be_inst = i_bedict # the new dict (without defaults)
index 1182cdf..82d9186 100644 (file)
@@ -343,8 +343,8 @@ BES_PARAMETER_TYPES = {
 
 BES_PARAMETERS = frozenset(BES_PARAMETER_TYPES.keys())
 
-# BE GROUP
-BEGR_DEFAULT = "default"
+# Instance Parameters Profile
+PP_DEFAULT = "default"
 
 # Hypervisor constants
 HT_XEN_PVM = "xen-pvm"
index e113d82..729a8be 100644 (file)
@@ -764,7 +764,7 @@ class Cluster(TaggableObject):
             constants.HVC_DEFAULTS[hypervisor], self.hvparams[hypervisor])
 
     if self.beparams is None:
-      self.beparams = {constants.BEGR_DEFAULT: constants.BEC_DEFAULTS}
+      self.beparams = {constants.PP_DEFAULT: constants.BEC_DEFAULTS}
     else:
       for begroup in self.beparams:
         self.beparams[begroup] = FillDict(constants.BEC_DEFAULTS,
@@ -814,8 +814,8 @@ class Cluster(TaggableObject):
         the cluster defaults
 
     """
-    return FillDict(self.beparams.get(constants.BEGR_DEFAULT, {}),
-                         instance.beparams)
+    return FillDict(self.beparams.get(constants.PP_DEFAULT, {}),
+                          instance.beparams)
 
 
 class SerializableConfigParser(ConfigParser.SafeConfigParser):
index 40c5d16..7ce75c1 100755 (executable)
@@ -185,7 +185,7 @@ def Cluster12To20(cluster):
     cluster['hvparams'] = constants.HVC_DEFAULTS
   if 'beparams' not in cluster:
     logging.info(" - adding beparams")
-    cluster['beparams'] = {constants.BEGR_DEFAULT: constants.BEC_DEFAULTS}
+    cluster['beparams'] = {constants.PP_DEFAULT: constants.BEC_DEFAULTS}
 
   # file storage
   if 'file_storage_dir' not in cluster: