From 8995d6402af864a23ee0e50ed7f338395f29d9a4 Mon Sep 17 00:00:00 2001 From: iberezovskiy Date: Tue, 13 May 2014 11:56:53 +0400 Subject: [PATCH] Export unbound variable DIB_RHSM_USER If 'DIB_RHSM_USER' isn't set, the image build with rhel element fails because of check 'set -u'. So, we should export 'DIB_RHSM_USER' in script to avoid error during build Change-Id: Ic63a20e3d91a25bbe804440a5919b035489c60a3 Closes-bug: #1318717 --- elements/rhel/finalise.d/60-rhsm-unregister | 2 ++ elements/rhel/pre-install.d/00-rhsm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/elements/rhel/finalise.d/60-rhsm-unregister b/elements/rhel/finalise.d/60-rhsm-unregister index 3ec367f4..6dc2d3f2 100755 --- a/elements/rhel/finalise.d/60-rhsm-unregister +++ b/elements/rhel/finalise.d/60-rhsm-unregister @@ -3,6 +3,8 @@ set -eu set -o pipefail +export DIB_RHSM_USER=${DIB_RHSM_USER:-} + if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ]; then if [[ "$DIB_REG_TYPE" == "rhn" ]]; then rm -rf /etc/sysconfig/rhn/systemid diff --git a/elements/rhel/pre-install.d/00-rhsm b/elements/rhel/pre-install.d/00-rhsm index 17efd239..17a3200c 100755 --- a/elements/rhel/pre-install.d/00-rhsm +++ b/elements/rhel/pre-install.d/00-rhsm @@ -3,6 +3,8 @@ set -eu set -o pipefail +export DIB_RHSM_USER=${DIB_RHSM_USER:-} + if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ] then opts="--force"