+ return self.SimpleFillBE(instance.beparams)
+
+ def SimpleFillNIC(self, nicparams):
+ """Fill a given nicparams dict with cluster defaults.
+
+ @type nicparams: dict
+ @param nicparams: the dict to fill
+ @rtype: dict
+ @return: a copy of the passed in nicparams with missing keys filled
+ from the cluster defaults
+
+ """
+ return FillDict(self.nicparams.get(constants.PP_DEFAULT, {}), nicparams)
+
+ def SimpleFillOS(self, os_name, os_params):
+ """Fill an instance's osparams dict with cluster defaults.
+
+ @type os_name: string
+ @param os_name: the OS name to use
+ @type os_params: dict
+ @param os_params: the dict to fill with default values
+ @rtype: dict
+ @return: a copy of the instance's osparams with missing keys filled from
+ the cluster defaults
+
+ """
+ name_only = os_name.split("+", 1)[0]
+ # base OS
+ result = self.osparams.get(name_only, {})
+ # OS with variant
+ result = FillDict(result, self.osparams.get(os_name, {}))
+ # specified params
+ return FillDict(result, os_params)