]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - tools/kvm/kvm_stat/kvm_stat
tools/kvm_stat: Don't use deprecated file()
authorCole Robinson <crobinso@redhat.com>
Fri, 23 Mar 2018 22:07:17 +0000 (18:07 -0400)
committerRadim Krčmář <rkrcmar@redhat.com>
Wed, 28 Mar 2018 20:47:06 +0000 (22:47 +0200)
commit0866c31bf32fbd05dd25b6ed4976fa9134773227
tree737b4b1586d6f6238cdc3f8af7cd088091cb0a34
parent6ade1ae84c9236cbb58de4b17f770f2791106676
tools/kvm_stat: Don't use deprecated file()

$ python3 tools/kvm/kvm_stat/kvm_stat
Traceback (most recent call last):
  File "tools/kvm/kvm_stat/kvm_stat", line 1668, in <module>
    main()
  File "tools/kvm/kvm_stat/kvm_stat", line 1639, in main
    assign_globals()
  File "tools/kvm/kvm_stat/kvm_stat", line 1618, in assign_globals
    for line in file('/proc/mounts'):
NameError: name 'file' is not defined

open() is the python3 way, and works on python2.6+

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-and-tested-by: Stefan Raspl <stefan.raspl@linux.vnet.ibm.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
tools/kvm/kvm_stat/kvm_stat