summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
authorJohn Morris <john@zultron.com>2014-04-20 17:06:54 -0500
committerJohn Morris <john@zultron.com>2014-04-21 11:13:26 -0500
commit2454dddb3a5a0afdcfc2f875edfdcc7b5a85d4ba (patch)
treeb6991acdcdf20b381d553fcada77c914fcbbf895 /src/sbin
parentd2ca484d6bd07c3d7b36a9da8b59f4c1c523445d (diff)
downloadbcfg2-2454dddb3a5a0afdcfc2f875edfdcc7b5a85d4ba.tar.gz
bcfg2-2454dddb3a5a0afdcfc2f875edfdcc7b5a85d4ba.tar.bz2
bcfg2-2454dddb3a5a0afdcfc2f875edfdcc7b5a85d4ba.zip
Enable bcfg2-yum-helper to depsolve for arches incompatible with server
By default, the yum dependency resolver uses the host's architecture to filter compatible packages. This prevents dependency resolution when the bcfg2 client's architecture is incompatible with the server's. This workaround checks the <Arch/> element for each of the client's yum sources, and if they are all identical, passes that architecture to bcfg2-yum-helper to override the default. The rpmUtils.arch module may only be configured for a single architecture. If multiple architectures are configured in yum sources, we don't know which one to pick, so use the default behavior instead.
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg2-yum-helper9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sbin/bcfg2-yum-helper b/src/sbin/bcfg2-yum-helper
index 227d977de..dc6a6cc0b 100755
--- a/src/sbin/bcfg2-yum-helper
+++ b/src/sbin/bcfg2-yum-helper
@@ -62,6 +62,10 @@ class YumHelper(object):
# pylint: enable=E1121,W0212
self.logger = logging.getLogger(self.__class__.__name__)
+ def setarch(self, arch):
+ """ Configure an arch other than the bcfg2 server arch for dep
+ resolution. """
+ self.yumbase.arch.setup_arch(arch=arch)
class DepSolver(YumHelper):
""" Yum dependency solver. This is used for operations that only
@@ -326,6 +330,11 @@ def main():
sys.exc_info()[1])
rv = 2
try:
+ # if provided, set client arch for dependency resolution
+ arch = data.get('arch', None)
+ if arch is not None:
+ depsolver.setarch(arch)
+
depsolver.groups = data['groups']
(packages, unknown) = depsolver.complete(
[pkg_to_tuple(p) for p in data['packages']])