Commit 4ef7f423 authored by Guido Trotter's avatar Guido Trotter
Browse files

Change BEGR_DEFAULT to PP_DEFAULT



This way the same constant can represent the default profile also for
nic, disk and OS parameters.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent abe609b2
......@@ -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,
......
......@@ -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)
......
......@@ -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"
......
......@@ -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):
......
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment