xapi-project / xen-api

The Xapi Project's XenAPI Server
http://xenproject.org/developers/teams/xapi.html
Other
346 stars 283 forks source link

CP-49906: Fix checker warnings for extauth-hook-AD #5781

Closed ashwin9390 closed 3 months ago

ashwin9390 commented 3 months ago

Main ticket and minimal preparation for:

CP-49906: Move extauth-hook-AD.py to python3 directory

To fix : https://github.com/ashwin9390/xen-api/actions/runs/9758441405

This PR has two commits to fix the issues that prevent the move in the above build.


[PATCH 1/2] Stop testing scripts/plugins/extauth-hook-AD.py with Python2.7

Preparations for cleaning up the checker warnings in extauth-hook-AD.py:

  1. The shebang of extauth-hook-AD.py has already been changed to Python3: Thus, stop testing it with Python3.

  2. This drops the Python2 code coverage to 28% (below 50%). We need to allow further drops in coverage: Set the limit to 0.


[PATCH 2/2] extauth-hook-AD.py: Fix pytype warnings, clean-up pylint suppressions

  1. pytype warnings need to be fixed before it can be moved to Python3.

    • pytype reports the uses @abc.abstractmethod as stray, disable.
    • Initialise upn: checkers (pytype, pyright) can't see that it is already handled OK.
  2. Clean-up obsolete inheriting from object: In Python3, all classes already always inherit from object.

Author: Signed-off-by: Bernhard Kaindl bernhard.kaindl@cloud.com

Committed by: Signed-off-by: Ashwinh ashwin.h@cloud.com