From e8d2522397ea6b4384607017c9cafb6f3130f5a2 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Sat, 5 Oct 2013 17:24:46 -0700 Subject: [PATCH] Use on-demand yum metadata caching in cfn-init Use on-demand yum metadata caching to avoid downloading 50MB (Fedora 19) of extra metadata that is not necessary for correct cfn-init operation. Reduces time to orchestration by about 23% and cpu utilization by about 50%. Full detailed analsys in the launchpad bug. Change-Id: Id51d6d506d6051b5e83f550ef318f86d84f3c7a7 Closes-Bug: 1235824 --- heat_cfntools/cfntools/cfn_helper.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/heat_cfntools/cfntools/cfn_helper.py b/heat_cfntools/cfntools/cfn_helper.py index 1d76bf7..5b1bf02 100644 --- a/heat_cfntools/cfntools/cfn_helper.py +++ b/heat_cfntools/cfntools/cfn_helper.py @@ -212,11 +212,6 @@ class RpmHelper(object): if rpmutils_present: _rpm_util = rpmupdates.Updates([], []) - @classmethod - def prepcache(cls): - """Prepare the yum cache.""" - CommandRunner("yum -y makecache").run() - @classmethod def compare_rpm_versions(cls, v1, v2): """Compare two RPM version strings. @@ -290,7 +285,7 @@ class RpmHelper(object): e.g., httpd-2.2.22 e.g., httpd-2.2.22-1.fc16 """ - cmd_str = "yum -C -y --showduplicates list available %s" % pkg + cmd_str = "yum -y --showduplicates list available %s" % pkg command = CommandRunner(cmd_str).run() return command.status == 0 @@ -417,8 +412,6 @@ class PackagesHandler(object): # collect pkgs for batch processing at end installs = [] downgrades = [] - # update yum cache - RpmHelper.prepcache() for pkg_name, versions in packages.iteritems(): ver = RpmHelper.newest_rpm_version(versions) pkg = "%s-%s" % (pkg_name, ver) if ver else pkg_name