From 499e2188aadf6ec9d91e30c715bb5678ad00d154 Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Tue, 3 May 2016 16:42:11 +0200 Subject: [PATCH] Remove OPM dependency resolution in prescript Previously, the dependencies for the openstack-puppet-modules and openstack-packstack-puppet RPMs were being manually resolved and installed in any non-installer node (usually the controller). Since Newton, the OPM package is a meta-package, that includes all the puppet-* packages as dependencies. In this context, Packstack would try to install all puppet-* packages in all nodes, which is not needed and causes issues. We are solving this by removing the dependency resolution code, adding a new array to include OPM dependencies (only rubygem-json as of now) and installing them when needed. Note that, if a dependency is added to any puppet package, it will have to be added to Packstack as well. CI will notify us, though. Change-Id: I54d0c0296c0b57946e7af1f7fd13dae35c1c1a36 --- packstack/installer/basedefs.py | 5 +---- packstack/plugins/prescript_000.py | 20 +------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/packstack/installer/basedefs.py b/packstack/installer/basedefs.py index 39b18e717..88ae6b561 100644 --- a/packstack/installer/basedefs.py +++ b/packstack/installer/basedefs.py @@ -83,10 +83,7 @@ except OSError: print ('Unable to create symbol link for log dir %s.' % LATEST_LOG_DIR) PUPPET_DEPENDENCIES = ['puppet', 'hiera', 'openssh-clients', 'tar', 'nc'] -PUPPET_MODULES_PKGS = [ - 'openstack-puppet-modules', - 'openstack-packstack-puppet' -] +PUPPET_MODULES_DEPS = ['rubygem-json'] FILE_INSTALLER_LOG = "setup.log" diff --git a/packstack/plugins/prescript_000.py b/packstack/plugins/prescript_000.py index 522a62826..1d4679cce 100644 --- a/packstack/plugins/prescript_000.py +++ b/packstack/plugins/prescript_000.py @@ -1309,25 +1309,7 @@ def preinstall_and_discover(config, messages): """ config['HOST_LIST'] = list(filtered_hosts(config)) - all_deps = '' - for pkg in basedefs.PUPPET_MODULES_PKGS: - local = utils.ScriptRunner() - local.append( - 'rpm -q --requires %s | egrep -v "^(rpmlib|\/|perl)"' % pkg - ) - # this can fail if there are no dependencies other than those - # filtered out by the egrep expression. - rc, pkg_deps = local.execute(can_fail=False) - errmsg = '%s is not installed' % pkg - if errmsg in pkg_deps: - # modules package might not be installed if we are running - # from source; in this case we assume user knows what (s)he's - # doing and we don't install modules dependencies - continue - all_deps += ' ' + pkg_deps.strip() - - deps = list(basedefs.PUPPET_DEPENDENCIES) - deps.extend([i.strip() for i in all_deps.split() if i.strip()]) + deps = list(basedefs.PUPPET_DEPENDENCIES) + list(basedefs.PUPPET_MODULES_DEPS) details = {} for hostname in config['HOST_LIST']: