From 41caf597a5ffb4f032f251cc1e5dac552e7aec67 Mon Sep 17 00:00:00 2001 From: iberezovskiy Date: Tue, 19 Nov 2013 15:13:48 +0400 Subject: [PATCH] Check existence of rhel rpm key The key 'RPM-GPG-KEY-redhat-release' may not exist in image e.g. when you use non-default image (for example, if you build CentOS image using rhel element). Fixes bug #1252697 Change-Id: Iae642abb7a7f76c5528750dafedd4fd4bda56fe2 --- elements/rhel/bin/install-packages | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elements/rhel/bin/install-packages b/elements/rhel/bin/install-packages index f3f6548c..7c46019d 100644 --- a/elements/rhel/bin/install-packages +++ b/elements/rhel/bin/install-packages @@ -33,6 +33,8 @@ do fi done if [ -n "$WHITELIST" ]; then - rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release + if [ -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release ]; then + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release + fi yum -y install $(map-packages $WHITELIST) fi