From f8416134cc80d704e6f139aa1ab1ce47e00e4f7f Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Thu, 5 Sep 2013 13:07:42 -0400 Subject: Allow Connector to create new groups Connector plugins can now create new groups, including the full range of options on those groups (profile, public, category, etc.). --- src/lib/Bcfg2/Server/Plugins/GroupLogic.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugins') diff --git a/src/lib/Bcfg2/Server/Plugins/GroupLogic.py b/src/lib/Bcfg2/Server/Plugins/GroupLogic.py index 810b273af..e581ebc6a 100644 --- a/src/lib/Bcfg2/Server/Plugins/GroupLogic.py +++ b/src/lib/Bcfg2/Server/Plugins/GroupLogic.py @@ -4,6 +4,7 @@ template to dynamically set additional groups for clients. """ import os import lxml.etree import Bcfg2.Server.Plugin +from Bcfg2.Server.Plugins.Metadata import MetadataGroup try: from Bcfg2.Server.Plugins.Bundler import BundleTemplateFile except ImportError: @@ -43,5 +44,11 @@ class GroupLogic(Bcfg2.Server.Plugin.Plugin, core.fam) def get_additional_groups(self, metadata): - return [el.get("name") - for el in self.config.get_xml_value(metadata).findall("Group")] + rv = [] + for el in self.config.get_xml_value(metadata).findall("Group"): + if el.get("category"): + rv.append(MetadataGroup(el.get("name"), + category=el.get("category"))) + else: + rv.append(el.get("name")) + return rv -- cgit v1.2.3-1-g7c22