"""
node = self._UnlockedGetNodeInfo(instance.primary_node)
nodegroup = self._UnlockedGetNodeGroup(node.group)
- return self._config_data.cluster.SimpleFillDP(nodegroup.diskparams)
+ return self._UnlockedGetGroupDiskParams(nodegroup)
+
+ @locking.ssynchronized(_config_lock, shared=1)
+ def GetGroupDiskParams(self, group):
+ """Get the disk params populated with inherit chain.
+
+ @type group: L{objects.NodeGroup}
+ @param group: The group we want to know the params for
+ @return: A dict with the filled in disk params
+
+ """
+ return self._UnlockedGetGroupDiskParams(group)
+
+ def _UnlockedGetGroupDiskParams(self, group):
+ """Get the disk params populated with inherit chain down to node-group.
+
+ @type group: L{objects.NodeGroup}
+ @param group: The group we want to know the params for
+ @return: A dict with the filled in disk params
+
+ """
+ return self._config_data.cluster.SimpleFillDP(group.diskparams)
@locking.ssynchronized(_config_lock, shared=1)
def GenerateMAC(self, ec_id):
except errors.ConfigurationError, err:
result.append("%s has invalid nicparams: %s" % (owner, err))
- def _helper_ipolicy(owner, params):
+ def _helper_ipolicy(owner, params, check_std):
try:
- objects.InstancePolicy.CheckParameterSyntax(params)
+ objects.InstancePolicy.CheckParameterSyntax(params, check_std)
except errors.ConfigurationError, err:
result.append("%s has invalid instance policy: %s" % (owner, err))
_helper_nic("cluster", cluster.SimpleFillNIC({}))
_helper("cluster", "ndparams", cluster.SimpleFillND({}),
constants.NDS_PARAMETER_TYPES)
- _helper_ipolicy("cluster", cluster.SimpleFillIPolicy({}))
+ _helper_ipolicy("cluster", cluster.SimpleFillIPolicy({}), True)
_helper_ispecs("cluster", cluster.SimpleFillIPolicy({}))
# per-instance checks
else:
nodegroups_names.add(nodegroup.name)
group_name = "group %s" % nodegroup.name
- _helper_ipolicy(group_name, cluster.SimpleFillIPolicy(nodegroup.ipolicy))
+ _helper_ipolicy(group_name, cluster.SimpleFillIPolicy(nodegroup.ipolicy),
+ False)
_helper_ispecs(group_name, cluster.SimpleFillIPolicy(nodegroup.ipolicy))
if nodegroup.ndparams:
_helper(group_name, "ndparams",