Skip to contentSkip to conversation

tools/xenmon: Fix xenmon.py for with python3.x

PATCH In review Bernhard Kaindl 3 participants 4 messages Feb 2, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/xenmon: Fix xenmon.py for with python3.x

Fixes for Py3:
* class Delayed(): file not defined; also an error for pylint -E
* Inconsistent use of tabs and spaces for indentation (in one block)

---
 tools/xenmon/xenmon.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/xenmon/xenmon.py +3 -3
index 175eacd2cb..3a81e43edf 100644
@@ -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():
     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"
Signature · 1 line
2.34.1
#2 lore raw
Quoted 9 lines · Andrew Cooper
Quoted 5 lines · Bernhard Kaindl

Fixes for Py3:
* class Delayed(): file not defined; also an error for pylint -E
* Inconsistent use of tabs and spaces for indentation (in one block)

I'll add this to my pending queue while staging is blocked.

Actually, on second thoughts.  Class DomainInfo and Delayed need to inherit from object for Py2 reasons.  Inheriting from file did this previously.

I can fix up on commit, if you're happy.

~Andrew

#3 lore raw
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Andrew Cooper
Quoted 5 lines · Bernhard Kaindl

Fixes for Py3:
* class Delayed(): file not defined; also an error for pylint -E
* Inconsistent use of tabs and spaces for indentation (in one block)

Quoted 8 lines
Quoted 3 lines

I'll add this to my pending queue while staging is blocked.

Actually, on second thoughts.  Class DomainInfo and Delayed need to inherit from object for Py2 reasons.  Inheriting from file did this previously.

I can fix up on commit, if you're happy.

Yes, thanks!

Signature · 1 line
cu, Bernhard