Project

General

Profile

Bug #38628

restful/api is not Python 3 compatible

Added by Sebastian Wagner over 1 year ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
restful module
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
QA
Backport:
nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

src/scripts/run_mypy.sh revealed some Python 3 problems:

pybind/mgr/restful/module.py: note: In member "run" of class "CommandsRequest":
pybind/mgr/restful/module.py:87: error: "CommandResult" has no attribute "command" 
pybind/mgr/restful/api/doc.py: note: In member "get" of class "Doc":
pybind/mgr/restful/api/doc.py:15: error: Module has no attribute "api" 
pybind/mgr/restful/decorators.py: note: In function "auth":
pybind/mgr/restful/decorators.py:21: error: Argument 1 to "split" of "bytes" has incompatible type "str"; expected "Optional[bytes]" 
pybind/mgr/restful/api/mon.py: note: In member "get" of class "MonName":
pybind/mgr/restful/api/mon.py:24: error: Argument 1 to "len" has incompatible type "Iterator[Any]"; expected "Sized" 
pybind/mgr/restful/api/mon.py:28: error: Value of type "Iterator[Any]" is not indexable
pybind/mgr/restful/api/request.py: note: In member "get" of class "RequestId":
pybind/mgr/restful/api/request.py:24: error: Argument 1 to "len" has incompatible type "Iterator[Any]"; expected "Sized" 
pybind/mgr/restful/api/request.py:28: error: Value of type "Iterator[Any]" is not indexable
pybind/mgr/restful/api/request.py: note: In member "delete" of class "Request":
pybind/mgr/restful/api/request.py:69: error: Incompatible types in assignment (expression has type "Iterator[Any]", variable has type "List[Any]")

In Python 3, filter returns an Iterator instead of a list. Even though some of the errors may be false-positives, they should be investigated.


Related issues

Related to mgr - Bug #38522: restful module traceback when querying any endpoint that require auth Resolved 03/01/2019
Copied to mgr - Backport #39695: nautilus: restful/api is not Python 3 compatible Resolved

History

#1 Updated by Kefu Chai about 1 year ago

  • Assignee set to Kefu Chai

#2 Updated by Kefu Chai about 1 year ago

  • Assignee deleted (Kefu Chai)
pybind/mgr/restful/decorators.py:21: error: Argument 1 to "split" of "bytes" has incompatible type "str"; expected "Optional[bytes]" 

is tracked by #38522. and was already fixed.

#3 Updated by Lenz Grimmer about 1 year ago

  • Related to Bug #38522: restful module traceback when querying any endpoint that require auth added

#4 Updated by Kefu Chai about 1 year ago

  • Status changed from New to Fix Under Review
  • Assignee set to Kefu Chai
  • Pull request ID set to 27925

#5 Updated by Kefu Chai about 1 year ago

  • Status changed from Fix Under Review to Resolved

#6 Updated by Sebastian Wagner about 1 year ago

  • Status changed from Resolved to Pending Backport
  • Backport set to nautilus

#7 Updated by Nathan Cutler about 1 year ago

  • Copied to Backport #39695: nautilus: restful/api is not Python 3 compatible added

#8 Updated by Sebastian Wagner 11 months ago

  • Category set to restful module

#9 Updated by Kefu Chai 10 months ago

  • Assignee deleted (Kefu Chai)

#10 Updated by Nathan Cutler about 2 months ago

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".

Also available in: Atom PDF