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 <frenaud@redhat.com>
This commit is contained in:
Stanislav Laznicka 2017-09-08 12:51:21 +02:00
parent 0f13e663ca
commit be9da19de3

View File

@ -3105,9 +3105,7 @@ def uninstall(options):
"Removing Kerberos service principals from /etc/krb5.keytab") "Removing Kerberos service principals from /etc/krb5.keytab")
try: try:
parser = RawConfigParser() parser = RawConfigParser()
fp = open(paths.IPA_DEFAULT_CONF, 'r') parser.read(paths.IPA_DEFAULT_CONF)
parser.readfp(fp)
fp.close()
realm = parser.get('global', 'realm') realm = parser.get('global', 'realm')
run([paths.IPA_RMKEYTAB, "-k", paths.KRB5_KEYTAB, "-r", realm]) run([paths.IPA_RMKEYTAB, "-k", paths.KRB5_KEYTAB, "-r", realm])
except CalledProcessError as err: except CalledProcessError as err: