summaryrefslogtreecommitdiff
blob: ff97af6839475b591cf6aed31d6d744372fec5d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From 5ce8d2aef85f590e4fb42d18784512203069d0c0 Mon Sep 17 00:00:00 2001
From: Bernhard Kaindl <bernhard.kaindl@citrix.com>
Date: Tue, 21 Mar 2023 13:49:47 +0100
Subject: [PATCH 41/61] tools/xenmon: Fix xenmon.py for with python3.x

Fixes for Py3:
* class Delayed(): file not defined; also an error for pylint -E.  Inherit
  object instead for Py2 compatibility.  Fix DomainInfo() too.
* Inconsistent use of tabs and spaces for indentation (in one block)

Signed-off-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 3a59443c1d5ae0677a792c660ccd3796ce036732
master date: 2023-02-06 10:22:12 +0000
---
 tools/xenmon/xenmon.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/xenmon/xenmon.py b/tools/xenmon/xenmon.py
index 175eacd2cb..977ada6887 100644
--- a/tools/xenmon/xenmon.py
+++ b/tools/xenmon/xenmon.py
@@ -117,7 +117,7 @@ def setup_cmdline_parser():
     return parser
 
 # encapsulate information about a domain
-class DomainInfo:
+class DomainInfo(object):
     def __init__(self):
         self.allocated_sum = 0
         self.gotten_sum = 0
@@ -533,7 +533,7 @@ def show_livestats(cpu):
 # simple functions to allow initialization of log files without actually
 # physically creating files that are never used; only on the first real
 # write does the file get created
-class Delayed(file):
+class Delayed(object):
     def __init__(self, filename, mode):
         self.filename = filename
         self.saved_mode = mode
@@ -677,8 +677,8 @@ def main():
 
     if os.uname()[0] == "SunOS":
         xenbaked_cmd = "/usr/lib/xenbaked"
-	stop_cmd = "/usr/bin/pkill -INT -z global xenbaked"
-	kill_cmd = "/usr/bin/pkill -KILL -z global xenbaked"
+        stop_cmd = "/usr/bin/pkill -INT -z global xenbaked"
+        kill_cmd = "/usr/bin/pkill -KILL -z global xenbaked"
     else:
         # assumes that xenbaked is in your path
         xenbaked_cmd = "xenbaked"
-- 
2.40.0