Commit e1ac33d8 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

pkgdep/rhel: Ignore subscription-manager failures

It seems that RHEL systems can be actively used without an actual
subscription. Since we don't really want to bother with this side
of the system, simply ignore all subscription-manager's failures.

See https://github.com/spdk/spdk/issues/1542

 as a reference.

Change-Id: I76a58cb38bb77b3b6deb12e0cc8ccca5f883d5a7
Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4360


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 0cd90081
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@ disclaimer() {
			# Don't trigger errexit, simply install what's available. This is default
			# behavior of older yum versions (e.g. the one present on RHEL 7.x) anyway.
			yum() { "$(type -P yum)" --skip-broken "$@"; }
			# For systems which are not registered, subscription-manager will most likely
			# fail on most calls so simply ignore its failures.
			sub() { subscription-manager "$@" || :; }
			;;

		*) ;;
@@ -52,8 +55,8 @@ if [[ $ID == centos || $ID == rhel ]]; then
	fi
	# Potential dependencies can be needed from other RHEL repos, enable them
	if [[ $ID == rhel ]]; then
		[[ $VERSION_ID == 7* ]] && subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"
		[[ $VERSION_ID == 8* ]] && subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
		[[ $VERSION_ID == 7* ]] && sub repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"
		[[ $VERSION_ID == 8* ]] && sub repos --enable codeready-builder-for-rhel-8-x86_64-rpms
	fi
fi