From be9da19de382162f60cdfc32f8b7d85c9c2bc0c8 Mon Sep 17 00:00:00 2001 From: Stanislav Laznicka Date: Sep 12 2017 15:43:23 +0000 Subject: uninstall: remove deprecation warning RawConfigParser.readfp() method is deprecated and throws DeprecationWarning in python 3 during uninstall. https://pagure.io/freeipa/issue/7131 Reviewed-By: Florence Blanc-Renaud --- diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py index b7293bb..e971aea 100644 --- a/ipaclient/install/client.py +++ b/ipaclient/install/client.py @@ -3105,9 +3105,7 @@ def uninstall(options): "Removing Kerberos service principals from /etc/krb5.keytab") try: parser = RawConfigParser() - fp = open(paths.IPA_DEFAULT_CONF, 'r') - parser.readfp(fp) - fp.close() + parser.read(paths.IPA_DEFAULT_CONF) realm = parser.get('global', 'realm') run([paths.IPA_RMKEYTAB, "-k", paths.KRB5_KEYTAB, "-r", realm]) except CalledProcessError as err: