Project

General

Profile

Actions

Bug #38628

closed

restful/api is not Python 3 compatible

Added by Sebastian Wagner about 5 years ago. Updated almost 4 years 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 (v1):
Crash signature (v2):

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 2 (0 open2 closed)

Related to mgr - Bug #38522: restful module traceback when querying any endpoint that require authResolvedBrad Hubbard03/01/2019

Actions
Copied to mgr - Backport #39695: nautilus: restful/api is not Python 3 compatibleResolvedPrashant DActions
Actions #1

Updated by Kefu Chai about 5 years ago

  • Assignee set to Kefu Chai
Actions #2

Updated by Kefu Chai almost 5 years 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.

Actions #3

Updated by Lenz Grimmer almost 5 years ago

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

Updated by Kefu Chai almost 5 years ago

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

Updated by Kefu Chai almost 5 years ago

  • Status changed from Fix Under Review to Resolved
Actions #6

Updated by Sebastian Wagner almost 5 years ago

  • Status changed from Resolved to Pending Backport
  • Backport set to nautilus
Actions #7

Updated by Nathan Cutler almost 5 years ago

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

Updated by Sebastian Wagner over 4 years ago

  • Category set to restful module
Actions #9

Updated by Kefu Chai over 4 years ago

  • Assignee deleted (Kefu Chai)
Actions #10

Updated by Nathan Cutler almost 4 years 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".

Actions

Also available in: Atom PDF