-
Notifications
You must be signed in to change notification settings - Fork 292
#PR2- CP-47869-Update XAPI code to python3. #5668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 21 commits
256fe98
f785993
c3d96a2
8e4b50d
b734b72
ddcda0b
b4c5764
051f3e3
93f5fee
88f5fd8
655ca9a
981f142
26acd48
333bec8
d73690d
2954895
756b9f2
9929318
5d0a5a6
e061a29
43d9130
ed86b8f
789b9e4
23ed63d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
PREFIX?=/usr | ||
PYTHON?=python2 | ||
PYTHON?=python3 | ||
|
||
.PHONY: build release clean install uninstall | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env python2 | ||
#!/usr/bin/env python3 | ||
|
||
""" | ||
Copyright (c) 2013-2018, Citrix Inc. | ||
Copyright (c) 2013-2024, Cloud Software Group,Inc. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
|
@@ -72,7 +72,7 @@ class XenAPIException(Exception): | |
|
||
def __init__(self, code, params): | ||
Exception.__init__(self) | ||
if not isinstance(code, str) and not isinstance(code, unicode): | ||
if not isinstance(code, str) and not isinstance(code, str): | ||
raise TypeError("string", repr(code)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file keeps py2 and py3 compatiblity by adding:
So just leave it as it is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we care about python 2 compatibility in this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file somehow upgrades to python3 in this way ( which I don't like). Since it works, better not to change it, except if we change it completely. |
||
if not isinstance(params, list): | ||
raise TypeError("list", repr(params)) | ||
|
@@ -139,7 +139,7 @@ def __init__(self, name): | |
|
||
def is_long(x): | ||
try: | ||
long(x) | ||
int(x) | ||
return True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same as previous one. |
||
except ValueError: | ||
return False | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
#!/usr/bin/env python2 | ||
#!/usr/bin/env python3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
#!/usr/bin/env python2 | ||
#!/usr/bin/env python3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
#!/usr/bin/env python2 | ||
#!/usr/bin/env python3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python2 | ||
#!/usr/bin/env python3 | ||
|
||
from xapi.storage import log | ||
import xapi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pylint: Reimport 'urllib.parse'