From fe157ca349e3146a53884e90e6e588efb4e97eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= Date: Thu, 10 Dec 2020 08:15:22 +0200 Subject: [PATCH] ipa-client-install: output a warning if sudo is not present MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://pagure.io/freeipa/issue/8530 Signed-off-by: François Cami Reviewed-By: Alexander Bokovoy Reviewed-By: Armando Neto Reviewed-By: Michal Polovka Reviewed-By: Alexander Bokovoy Reviewed-By: Armando Neto Reviewed-By: Michal Polovka Reviewed-By: Florence Blanc-Renaud --- ipaclient/install/client.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py index 8acfa0cd1..0e478fa26 100644 --- a/ipaclient/install/client.py +++ b/ipaclient/install/client.py @@ -24,6 +24,7 @@ import re import SSSDConfig import shutil import socket +import subprocess import sys import tempfile import textwrap @@ -2200,7 +2201,18 @@ def install_check(options): "authentication resources", rval=CLIENT_INSTALL_ERROR) - # when installing with '--no-sssd' option, check whether nss-ldap is + # When installing without the "--no-sudo" option, check whether sudo is + # available. + if options.conf_sudo: + try: + subprocess.Popen(['sudo -V']) + except FileNotFoundError: + logger.info( + "The sudo binary does not seem to be present on this " + "system. Please consider installing sudo if required." + ) + + # when installing with the '--no-sssd' option, check whether nss-ldap is # installed if not options.sssd: if not os.path.exists(paths.PAM_KRB5_SO):