-
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
#PR2- CP-47869-Update XAPI code to python3. #5668
Conversation
…storage/_index.md b/doc/content/xapi/storage/_index.md Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…otocol.md b/ocaml/doc/wire-protocol.md Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…s/datapath/block/Datapath.activate Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…/datapath/block/Datapath.deactivate Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…s/datapath/block/Datapath.attach Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…s/datapath/block/Datapath.detach Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…s/datapath/loop+blkback/datapath.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…ge/python/examples/datapath/loop+blkback/plugin.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…e/python/examples/volume/org.xen.xapi.storage.simple-file/sr.py - Changed shebhang and copyright in /ocaml/xapi-storage/python/examples/volume/org.xen.xapi.storage.simple-file/plugin.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅ Additional details and impacted files@@ Coverage Diff @@
## feature/py3 #5668 +/- ##
==============================================
- Coverage 86.0% 68.6% -17.4%
==============================================
Files 13 30 +17
Lines 2130 3557 +1427
==============================================
+ Hits 1832 2441 +609
- Misses 298 1116 +818 see 35 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. |
ocaml/xapi-storage/python/examples/volume/org.xen.xapi.storage.simple-file/volume.py
Show resolved
Hide resolved
…s/volume/org.xen.xapi.storage.simple-file/volume.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…storage/__init__.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…storage/common.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…storage/api/v5/__init__.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…thon/provision.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…init__.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…torage/api/__init__.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…/action.yml Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…le-attr] in /scripts/examples/python/mini-xenrt.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…in scripts/examples/smapiv2.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…in pyproject.toml Signed-off-by: Ashwinh <ashwin.h@cloud.com>
@@ -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): |
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.
This file keeps py2 and py3 compatiblity by adding:
if sys.version_info[0] > 2:
long = int
unicode = str
So just leave it as it is.
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.
Do we care about python 2 compatibility in this case?
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.
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.
@@ -139,7 +139,7 @@ def __init__(self, name): | |||
|
|||
def is_long(x): | |||
try: | |||
long(x) | |||
int(x) |
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.
The same as previous one.
…/xapi/__init__.py" This reverts commit d73690d. Signed-off-by: Ashwinh <ashwin.h@cloud.com>
…__init__.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
import urllib | ||
import urlparse | ||
import urllib.request, urllib.parse, urllib.error | ||
import urllib.parse |
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'
…s/volume/org.xen.xapi.storage.simple-file/sr.py Signed-off-by: Ashwinh <ashwin.h@cloud.com>
Main ticket:CP-47869 -Clean up XAPI code
Sub task :CP-49681
Split2 from #5662
Test done in PR 5662 holds good.
Test result -198930 (Dev Run)
Ring0 BST - 8.4.0-206415 (pbb-ashwinh-xapiclean) (repo) run 30 May 2024
Tests Executed (excludes blocked): 47
Tests Failed: 1
Tests Errored: 0
Tests Blocked: 0
Tests Not Executed: 0
Test failed due to production issues: 0
Pass rate (excluding failures due to non product issues): 100.0%
Pass rate (of testcases XenRT was able to resource): 97.9%
Pass rate (of all test cases): 97.9%
Percentage of nightly complete: 100.0%
Tests excluded from numbers: 0
Signed-off-by: Ashwinh ashwin.h@cloud.com
@liulinC @stephenchengCloud @psafont