URL: https://github.com/freeipa/freeipa/pull/1054
Author: stlaz
 Title: #1054: uninstall: remove deprecation warning
Action: opened

PR body:
"""
RawConfigParser.readfp() method is deprecated and throws
DeprecationWarning in python 3 during uninstall.

https://pagure.io/freeipa/issue/7131
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1054/head:pr1054
git checkout pr1054
From 1401edea87c3d48e3ab1c5a93dee27f61766e505 Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Fri, 8 Sep 2017 12:51:21 +0200
Subject: [PATCH] uninstall: remove deprecation warning

RawConfigParser.readfp() method is deprecated and throws
DeprecationWarning in python 3 during uninstall.

https://pagure.io/freeipa/issue/7131
---
 ipaclient/install/client.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py
index b7293bb29f..e971aeab48 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:
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to