summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-09-09 16:00:43 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-09-09 16:00:43 -0400
commitece78e71a84c19da694d0122be2e6d78d08d8e8d (patch)
tree3008718e6ad81dee51dc04d501670ee247c2108f /src/lib
parent6b662945b58eafd8e27f0191f4d7a78e7cc4ad05 (diff)
parent8fd0dad3e99f4452a6cd3f27e5c97efd9fc308e7 (diff)
downloadbcfg2-ece78e71a84c19da694d0122be2e6d78d08d8e8d.tar.gz
bcfg2-ece78e71a84c19da694d0122be2e6d78d08d8e8d.tar.bz2
bcfg2-ece78e71a84c19da694d0122be2e6d78d08d8e8d.zip
Merge branch 'maint'
Conflicts: src/lib/Bcfg2/Server/Plugins/Cfg/CfgAuthorizedKeysGenerator.py src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py testsuite/Testsrc/Testlib/TestClient/TestTools/TestPOSIXUsers.py
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIXUsers.py4
-rw-r--r--src/lib/Bcfg2/Server/Core.py3
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Cfg/CfgAuthorizedKeysGenerator.py8
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py2
4 files changed, 10 insertions, 7 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/POSIXUsers.py b/src/lib/Bcfg2/Client/Tools/POSIXUsers.py
index aeafc3817..58a3bbdfc 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIXUsers.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIXUsers.py
@@ -3,6 +3,7 @@ and groupadd/mod/del """
import pwd
import grp
+import Bcfg2.Options
import Bcfg2.Client.XML
import Bcfg2.Client.Tools
from Bcfg2.Utils import PackedDigitRange
@@ -202,7 +203,8 @@ class POSIXUsers(Bcfg2.Client.Tools.Tool):
else:
for attr, idx in self.attr_mapping[entry.tag].items():
val = str(self.existing[entry.tag][entry.get("name")][idx])
- entry.set("current_%s" % attr, val)
+ entry.set("current_%s" %
+ attr, val.decode(Bcfg2.Options.setup.encoding))
if attr in ["uid", "gid"]:
if entry.get(attr) is None:
# no uid/gid specified, so we let the tool
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py
index 4eb151c29..3eb84f45f 100644
--- a/src/lib/Bcfg2/Server/Core.py
+++ b/src/lib/Bcfg2/Server/Core.py
@@ -23,7 +23,6 @@ from Bcfg2.Compat import xmlrpclib # pylint: disable=W0622
from Bcfg2.Server.Plugin.exceptions import * # pylint: disable=W0401,W0614
from Bcfg2.Server.Plugin.interfaces import * # pylint: disable=W0401,W0614
from Bcfg2.Server.Plugin import track_statistics
-from Bcfg2.Server.Plugins.Metadata import MetadataGroup
try:
import psyco
@@ -858,7 +857,7 @@ class Core(object):
groups = conn.get_additional_groups(imd)
groupnames = []
for group in groups:
- if isinstance(group, MetadataGroup):
+ if hasattr(group, "name"):
groupname = group.name
if groupname in self._dynamic_groups:
if self._dynamic_groups[groupname] == conn.name:
diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgAuthorizedKeysGenerator.py b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgAuthorizedKeysGenerator.py
index 895752c9c..7792d7e5c 100644
--- a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgAuthorizedKeysGenerator.py
+++ b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgAuthorizedKeysGenerator.py
@@ -50,19 +50,19 @@ class CfgAuthorizedKeysGenerator(CfgGenerator, StructFile):
if pubkey_name:
host = allow.get("host")
group = allow.get("group")
+ category = allow.get("category",
+ Bcfg2.Options.setup.sshkeys_category)
if host:
key_md = self.core.build_metadata(host)
elif group:
key_md = ClientMetadata("dummy", group, [group], [],
set(), set(), dict(), None,
None, None, None)
- elif (Bcfg2.Options.setup.sshkeys_category and
- not metadata.group_in_category(
- Bcfg2.Options.setup.sshkeys_category)):
+ elif category and not metadata.group_in_category(category):
self.logger.warning("Cfg: %s ignoring Allow from %s: "
"No group in category %s" %
(metadata.hostname, pubkey_name,
- Bcfg2.Options.setup.sshkeys_category))
+ category))
continue
else:
key_md = metadata
diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
index 5b32a91c0..632a5c3bf 100644
--- a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
+++ b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
@@ -80,6 +80,8 @@ class CfgBaseFileMatcher(Bcfg2.Server.Plugin.SpecificData):
experimental = False
def __init__(self, name, specific):
+ if not self.__specific__ and not specific:
+ specific = Bcfg2.Server.Plugin.Specificity(all=True)
Bcfg2.Server.Plugin.SpecificData.__init__(self, name, specific)
__init__.__doc__ = Bcfg2.Server.Plugin.SpecificData.__init__.__doc__ + \
"""