]> git.proxmox.com Git - mirror_qemu.git/commitdiff
iotests: Replace deprecated ConfigParser.readfp()
authorKevin Wolf <kwolf@redhat.com>
Fri, 13 Nov 2020 10:06:02 +0000 (11:06 +0100)
committerKevin Wolf <kwolf@redhat.com>
Tue, 17 Nov 2020 11:26:47 +0000 (12:26 +0100)
iotest 277 fails on Fedora 33 (Python 3.9) because a deprecation warning
changes the output:

    nbd-fault-injector.py:230: DeprecationWarning: This method will be
    removed in future versions.  Use 'parser.read_file()' instead.

In fact, readfp() has already been deprecated in Python 3.2 and the
replacement has existed since the same version, so we can now
unconditionally switch to read_file().

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20201113100602.15936-1-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/qemu-iotests/nbd-fault-injector.py

index 78f42c421432bcc0cd10173697fd07b2a17b8aaa..6e11ef89b8b38075370e705b950af6d0dd4a55b1 100755 (executable)
@@ -227,7 +227,7 @@ def parse_config(config):
 def load_rules(filename):
     config = configparser.RawConfigParser()
     with open(filename, 'rt') as f:
-        config.readfp(f, filename)
+        config.read_file(f, filename)
     return parse_config(config)
 
 def open_socket(path):