diff options
author | Cole Robinson <crobinso@redhat.com> | 2018-03-23 18:07:17 -0400 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2018-03-28 16:47:06 -0400 |
commit | 0866c31bf32fbd05dd25b6ed4976fa9134773227 (patch) | |
tree | 737b4b1586d6f6238cdc3f8af7cd088091cb0a34 | |
parent | 6ade1ae84c9236cbb58de4b17f770f2791106676 (diff) |
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>
-rwxr-xr-x | tools/kvm/kvm_stat/kvm_stat | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat index 645d4bb69f5f..651b7f08bb2c 100755 --- a/tools/kvm/kvm_stat/kvm_stat +++ b/tools/kvm/kvm_stat/kvm_stat | |||
@@ -1615,7 +1615,7 @@ def assign_globals(): | |||
1615 | global PATH_DEBUGFS_TRACING | 1615 | global PATH_DEBUGFS_TRACING |
1616 | 1616 | ||
1617 | debugfs = '' | 1617 | debugfs = '' |
1618 | for line in file('/proc/mounts'): | 1618 | for line in open('/proc/mounts'): |
1619 | if line.split(' ')[0] == 'debugfs': | 1619 | if line.split(' ')[0] == 'debugfs': |
1620 | debugfs = line.split(' ')[1] | 1620 | debugfs = line.split(' ')[1] |
1621 | break | 1621 | break |