mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-25 08:21:05 -06:00
py3: ConfigParser: replace deprecated readfd with read
ConfigParser.readfd() is deprecated in py3, we can use .read() which is compatible with py2 https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
parent
2e63ec42d0
commit
6e7071d6ad
@ -749,10 +749,9 @@ def read_replica_info(dir_path, rconfig):
|
||||
|
||||
rconfig is a ReplicaConfig object
|
||||
"""
|
||||
filename = dir_path + "/realm_info"
|
||||
fd = open(filename)
|
||||
filename = os.path.join(dir_path, "realm_info")
|
||||
config = SafeConfigParser()
|
||||
config.readfp(fd)
|
||||
config.read(filename)
|
||||
|
||||
rconfig.realm_name = config.get("realm", "realm_name")
|
||||
rconfig.master_host_name = config.get("realm", "master_host_name")
|
||||
|
@ -711,9 +711,8 @@ class Restore(admintool.AdminTool):
|
||||
Read the backup file header that contains the meta data about
|
||||
this particular backup.
|
||||
'''
|
||||
with open(self.header) as fd:
|
||||
config = SafeConfigParser()
|
||||
config.readfp(fd)
|
||||
config = SafeConfigParser()
|
||||
config.read(self.header)
|
||||
|
||||
self.backup_type = config.get('ipa', 'type')
|
||||
self.backup_time = config.get('ipa', 'time')
|
||||
|
Loading…
Reference in New Issue
Block a user