File do-not-use-configparser.readfp-in-nilrt_ip-module.patch of Package salt

From 0828c76b39e299557b8d1eb34285af5e3eafd021 Mon Sep 17 00:00:00 2001
From: Alexander Graul <agraul@suse.com>
Date: Tue, 10 Jun 2025 16:02:35 +0200
Subject: [PATCH] Do not use ConfigParser.readfp in nilrt_ip module

---
 salt/modules/nilrt_ip.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/salt/modules/nilrt_ip.py b/salt/modules/nilrt_ip.py
index 84612d7a17d..d29e3f118c2 100644
--- a/salt/modules/nilrt_ip.py
+++ b/salt/modules/nilrt_ip.py
@@ -271,7 +271,7 @@ def _load_config(section, options, default_value="", filename=INI_FILE):
         config_parser = configparser.RawConfigParser(
             dict_type=CaseInsensitiveDict, converters={"unquoted": _remove_quotes}
         )
-        config_parser.readfp(config_file)
+        config_parser.read_file(config_file)
         for option in options:
             results[option] = config_parser.getunquoted(
                 section, option, fallback=default_value
@@ -576,7 +576,7 @@ def _change_dhcp_config(interface, enable_dhcp=True, filename=INTERFACES_CONFIG)
     if os.path.exists(filename):
         try:
             with salt.utils.files.fopen(filename, "r") as config_file:
-                parser.readfp(config_file)
+                parser.read_file(config_file)
         except configparser.MissingSectionHeaderError:
             pass
     interface = pyiface.Interface(name=interface)
@@ -858,7 +858,7 @@ def _configure_static_interface(interface, **settings):
     if os.path.exists(INTERFACES_CONFIG):
         try:
             with salt.utils.files.fopen(INTERFACES_CONFIG, "r") as config_file:
-                parser.readfp(config_file)
+                parser.read_file(config_file)
         except configparser.MissingSectionHeaderError:
             pass
     hwaddr = interface.hwaddr[:-1]
-- 
2.49.0

openSUSE Build Service is sponsored by