diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-09-05 13:07:42 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-09-05 13:07:43 -0400 |
commit | f8416134cc80d704e6f139aa1ab1ce47e00e4f7f (patch) | |
tree | 517443490d17699c0c40ee165adb0ae80ab6146d /src/lib/Bcfg2/Server/Plugins/GroupLogic.py | |
parent | 5c9cd24767bcbc8cdb39eebf2fd81e9c814c01af (diff) | |
download | bcfg2-f8416134cc80d704e6f139aa1ab1ce47e00e4f7f.tar.gz bcfg2-f8416134cc80d704e6f139aa1ab1ce47e00e4f7f.tar.bz2 bcfg2-f8416134cc80d704e6f139aa1ab1ce47e00e4f7f.zip |
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.).
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/GroupLogic.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/GroupLogic.py | 11 |
1 files changed, 9 insertions, 2 deletions
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 |