From 15ec2847ad41fc25ee1b9da369585ccd5c146b0c Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Fri, 10 Oct 2014 13:16:14 +0400 Subject: [PATCH] Optimize check for RHEL GPG key Reduces the time to check for presence of gpg pubkey for RabbitMQ from 1.6s to 0.1s. --- manifests/repo/rhel.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/repo/rhel.pp b/manifests/repo/rhel.pp index f2271cd46..4aa319f6f 100644 --- a/manifests/repo/rhel.pp +++ b/manifests/repo/rhel.pp @@ -6,7 +6,7 @@ exec { "rpm --import ${package_gpg_key}": path => ['/bin','/usr/bin','/sbin','/usr/sbin'], - onlyif => 'test `rpm -qa | grep gpg-pubkey-056e8e56-468e43f2 | wc -l` -eq 0', + unless => 'rpm -q gpg-pubkey-056e8e56-468e43f2 2>/dev/null', } }