diff options
-rw-r--r-- | src/lib/Bcfg2/Client/Tools/POSIX/base.py | 11 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/Yum.py | 21 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/__init__.py | 4 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Probes.py | 2 |
4 files changed, 23 insertions, 15 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/base.py b/src/lib/Bcfg2/Client/Tools/POSIX/base.py index 94a490fda..355f70ac9 100644 --- a/src/lib/Bcfg2/Client/Tools/POSIX/base.py +++ b/src/lib/Bcfg2/Client/Tools/POSIX/base.py @@ -138,8 +138,15 @@ class POSIXTool(Bcfg2.Client.Tools.Tool): rv &= self._set_acls(entry, path=path) return rv - def _apply_acl(self, acl, path, atype=posix1e.ACL_TYPE_ACCESS): + def _apply_acl(self, acl, path, atype=None): """ Apply the given ACL to the given path """ + if atype is None: + # the default value for atype is set this way (rather than + # in the argument list) because posix1e libs may not be + # installed, and this code is executed at run-time (and + # thus will never be reached if ACLs aren't supported), + # but argument lists are parsed at compile-time + atype = posix1e.ACL_TYPE_ACCESS if atype == posix1e.ACL_TYPE_ACCESS: atype_str = "access" else: @@ -516,8 +523,6 @@ class POSIXTool(Bcfg2.Client.Tools.Tool): if val is not None: entry.set(attr, str(val)) - print "about to verify acls; errors=%s" % errors - return self._verify_acls(entry, path=path) and len(errors) == 0 def _list_entry_acls(self, entry): diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py index 04d4e9f74..592369029 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py @@ -598,17 +598,20 @@ class YumCollection(Collection): attrs = dict(version=self.setup.cfp.get("packages", "version", default="auto")) - if attrs['version'] == 'any': + if attrs['version'] == 'any' or not isinstance(pkgtup, tuple): return attrs - if pkgtup[1]: - attrs['arch'] = pkgtup[1] - if pkgtup[2]: - attrs['epoch'] = pkgtup[2] - if pkgtup[3]: - attrs['version'] = pkgtup[3] - if pkgtup[4]: - attrs['release'] = pkgtup[4] + try: + if pkgtup[1]: + attrs['arch'] = pkgtup[1] + if pkgtup[2]: + attrs['epoch'] = pkgtup[2] + if pkgtup[3]: + attrs['version'] = pkgtup[3] + if pkgtup[4]: + attrs['release'] = pkgtup[4] + except IndexError: + self.logger.warning("Malformed package tuple: %s" % pkgtup) return attrs packages = dict() diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py index 6f8e3ecad..628ba929f 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py @@ -458,7 +458,7 @@ class Packages(Bcfg2.Server.Plugin.Plugin, if not self.sources.loaded: # if sources.xml has not received a FAM event yet, defer; # instantiate a dummy Collection object - return Collection(metadata, [], self.data) + return Collection(metadata, [], self.cachepath) if metadata.hostname in self.clients: return self.collections[self.clients[metadata.hostname]] @@ -488,7 +488,7 @@ class Packages(Bcfg2.Server.Plugin.Plugin, self.logger.error("Packages: Using %s for Collection of sources " "for %s" % (cclass.__name__, metadata.hostname)) - collection = cclass(metadata, relevant, self.data, + collection = cclass(metadata, relevant, self.cachepath, debug=self.debug_flag) ckey = collection.cachekey self.clients[metadata.hostname] = ckey diff --git a/src/lib/Bcfg2/Server/Plugins/Probes.py b/src/lib/Bcfg2/Server/Plugins/Probes.py index 700c5e2e8..59e4edc73 100644 --- a/src/lib/Bcfg2/Server/Plugins/Probes.py +++ b/src/lib/Bcfg2/Server/Plugins/Probes.py @@ -74,7 +74,7 @@ class ProbeData(str): return str.__new__(cls, data) def __init__(self, data): - str.__init__(self, data) + str.__init__(self) self._xdata = None self._json = None self._yaml = None |