From 9b102b687088bf8d5c2a5984aa5bd4f34418e9ec Mon Sep 17 00:00:00 2001 From: Michele Bussolotto Date: Wed, 17 Apr 2024 10:39:05 +0200 Subject: [PATCH] Hide message in stdout if SCCcredentials is missing (bsc#1222277) (#231) --- mgradm/shared/utils/exec.go | 4 ++-- uyuni-tools.changes.mbussolotto.hide_scc | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 uyuni-tools.changes.mbussolotto.hide_scc diff --git a/mgradm/shared/utils/exec.go b/mgradm/shared/utils/exec.go index 4372f7311..567ef5e30 100644 --- a/mgradm/shared/utils/exec.go +++ b/mgradm/shared/utils/exec.go @@ -34,8 +34,8 @@ var inspectValues = []types.InspectData{ types.NewInspectData("image_pg_version", "rpm -qa --qf '%{VERSION}\\n' 'name=postgresql[0-8][0-9]-server' | cut -d. -f1 | sort -n | tail -1 || true"), types.NewInspectData("current_pg_version", "(test -e /var/lib/pgsql/data/PG_VERSION && cat /var/lib/pgsql/data/PG_VERSION) || true"), types.NewInspectData("registration_info", "transactional-update --quiet register --status 2>/dev/null || true"), - types.NewInspectData("scc_username", "cat /etc/zypp/credentials.d/SCCcredentials | grep username | cut -d= -f2 || true"), - types.NewInspectData("scc_password", "cat /etc/zypp/credentials.d/SCCcredentials | grep password | cut -d= -f2 || true"), + types.NewInspectData("scc_username", "(test -e /etc/zypp/credentials.d/SCCcredentials && cat /etc/zypp/credentials.d/SCCcredentials | grep username | cut -d= -f2) || true"), + types.NewInspectData("scc_password", "(test -e /etc/zypp/credentials.d/SCCcredentials && cat /etc/zypp/credentials.d/SCCcredentials | grep password | cut -d= -f2) || true"), } // InspectOutputFile represents the directory and the basename where the inspect values are stored. diff --git a/uyuni-tools.changes.mbussolotto.hide_scc b/uyuni-tools.changes.mbussolotto.hide_scc new file mode 100644 index 000000000..bf0e5a231 --- /dev/null +++ b/uyuni-tools.changes.mbussolotto.hide_scc @@ -0,0 +1 @@ +- Hide message in stdout if SCCcredentials is missing (bsc#1222277)