summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Metadata.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-01 08:10:29 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-01 08:12:39 -0400
commit03ae03918aea6ed1a8f1ada1f02b7af0ad84c3ea (patch)
tree37717bfb96a7fa112e184ff61998b68c42d22551 /src/lib/Bcfg2/Server/Plugins/Metadata.py
parent9c5aa1949b80c3fe96535ca82bee6f6c9b2d9248 (diff)
downloadbcfg2-03ae03918aea6ed1a8f1ada1f02b7af0ad84c3ea.tar.gz
bcfg2-03ae03918aea6ed1a8f1ada1f02b7af0ad84c3ea.tar.bz2
bcfg2-03ae03918aea6ed1a8f1ada1f02b7af0ad84c3ea.zip
Metadata: don't require all profile groups to be public when using metadata db
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Metadata.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Metadata.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Metadata.py b/src/lib/Bcfg2/Server/Plugins/Metadata.py
index bdf3b87fe..8aeda9f81 100644
--- a/src/lib/Bcfg2/Server/Plugins/Metadata.py
+++ b/src/lib/Bcfg2/Server/Plugins/Metadata.py
@@ -945,7 +945,7 @@ class Metadata(Bcfg2.Server.Plugin.Metadata,
self.debug_log("Client %s set as nonexistent group %s"
% (client, group))
- def set_profile(self, client, profile, addresspair):
+ def set_profile(self, client, profile, addresspair, require_public=True):
"""Set group parameter for provided client."""
self.logger.info("Asserting client %s profile to %s" % (client,
profile))
@@ -957,7 +957,7 @@ class Metadata(Bcfg2.Server.Plugin.Metadata,
self.logger.error(msg)
raise Bcfg2.Server.Plugin.MetadataConsistencyError(msg)
group = self.groups[profile]
- if not group.is_public:
+ if require_public and not group.is_public:
msg = "Cannot set client %s to private group %s" % (client,
profile)
self.logger.error(msg)
@@ -1128,7 +1128,8 @@ class Metadata(Bcfg2.Server.Plugin.Metadata,
pgroup = self.default
if pgroup:
- self.set_profile(client, pgroup, (None, None))
+ self.set_profile(client, pgroup, (None, None),
+ require_public=False)
profile = _add_group(pgroup)
else:
msg = "Cannot add new client %s; no default group set" % client