From 39246ecc1f9ad211a0bcbcb567bef763d8e0c3c5 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 26 Oct 2012 13:34:31 -0400 Subject: set profile group from Connector groups if not set initially; set from default group if not set by Connectors --- src/lib/Bcfg2/Server/Plugins/Metadata.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/lib/Bcfg2/Server/Plugins/Metadata.py b/src/lib/Bcfg2/Server/Plugins/Metadata.py index 5b552a01f..f6b05d451 100644 --- a/src/lib/Bcfg2/Server/Plugins/Metadata.py +++ b/src/lib/Bcfg2/Server/Plugins/Metadata.py @@ -1137,6 +1137,17 @@ class Metadata(Bcfg2.Server.Plugin.Metadata, if group in self.groups: imd.bundles.update(self.groups[group].bundles) + if not imd.profile: + # if the client still doesn't have a profile group after + # initial metadata, try to find one in the additional + # groups + profiles = [g for g in groups + if g in self.groups and self.groups[g].is_profile] + if len(profiles) >= 1: + imd.profile = profiles[0] + elif self.default: + imd.profile = self.default + def merge_additional_data(self, imd, source, data): if not hasattr(imd, source): setattr(imd, source, data) -- cgit v1.2.3-1-g7c22