summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-10-26 13:34:31 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-10-26 13:34:37 -0400
commit39246ecc1f9ad211a0bcbcb567bef763d8e0c3c5 (patch)
treed186bbd717570d7fb983e9ca7b2e225d4e050271 /src/lib/Bcfg2
parent10589a2586e06c14f53c676e7121e04225352a80 (diff)
downloadbcfg2-39246ecc1f9ad211a0bcbcb567bef763d8e0c3c5.tar.gz
bcfg2-39246ecc1f9ad211a0bcbcb567bef763d8e0c3c5.tar.bz2
bcfg2-39246ecc1f9ad211a0bcbcb567bef763d8e0c3c5.zip
set profile group from Connector groups if not set initially; set from default group if not set by Connectors
Diffstat (limited to 'src/lib/Bcfg2')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Metadata.py11
1 files changed, 11 insertions, 0 deletions
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)