summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Metadata.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py
index d78592f14..21c69e5bd 100644
--- a/src/lib/Server/Plugins/Metadata.py
+++ b/src/lib/Server/Plugins/Metadata.py
@@ -82,6 +82,7 @@ class Metadata(Bcfg2.Server.Plugin.Plugin,
self.groups = {}
self.cgroups = {}
self.public = []
+ self.private = []
self.profiles = []
self.categories = {}
self.bad_clients = {}
@@ -277,7 +278,7 @@ class Metadata(Bcfg2.Server.Plugin.Plugin,
client_tree.close()
def update_client(self, client_name, attribs):
- '''Update a client's attributes'''
+ '''Update a clients attributes'''
tree = lxml.etree.parse(self.data + "/clients.xml")
root = tree.getroot()
node = self.search_client(client_name, tree)
@@ -379,6 +380,7 @@ class Metadata(Bcfg2.Server.Plugin.Plugin,
in client.findall('Alias')]
elif dest == 'groups.xml':
self.public = []
+ self.private = []
self.profiles = []
self.groups = {}
grouptmp = {}
@@ -394,6 +396,8 @@ class Metadata(Bcfg2.Server.Plugin.Plugin,
self.profiles.append(group.get('name'))
if group.get('public', 'false') == 'true':
self.public.append(group.get('name'))
+ elif group.get('public', 'true') == 'false':
+ self.private.append(group.get('name'))
if 'category' in group.attrib:
self.categories[group.get('name')] = group.get('category')
for group in grouptmp:
@@ -578,6 +582,9 @@ class Metadata(Bcfg2.Server.Plugin.Plugin,
if g in self.categories and \
self.categories[g] in imd.categories:
continue
+ if g in self.private:
+ self.logger.error("Refusing to add dynamic membership in private group %s for client %s" % (g, imd.hostname))
+ continue
imd.groups.add(g)
def merge_additional_data(self, imd, source, data):