Repository navigation
Project: Host Maintenance Policy - #582
Conversation
* Added support for changes in Account Events, Maintenance, and Settings * Added support for changes in Instance and added Maintenance group * Add docstring and fix imports
Resolve MappedObject unpacking error
Maintenance Policy integration test
| from .lke import * | ||
| from .lke_tier import * | ||
| from .longview import * | ||
| from .maintenance import * |
Check notice
Code scanning / CodeQL
'import *' may pollute namespace
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI over 1 year ago
To fix the problem, we should avoid using from .maintenance import * unless the maintenance module defines an __all__ variable that restricts the exported names. Since we cannot edit maintenance.py (as it was not provided), the best fix is to explicitly import only the names that are needed from .maintenance. This requires knowing which names are used from .maintenance in this file or elsewhere in the package. If all names are needed, we should list them explicitly. If only a subset is needed, we should import only those. For this fix, we will replace from .maintenance import * with an explicit import statement listing the required names (using placeholder names if the actual names are unknown).
Edit only line 13 in linode_api4/groups/__init__.py, replacing the import * with explicit imports.
| @@ -10,7 +10,7 @@ | ||
| from .lke import * | ||
| from .lke_tier import * | ||
| from .longview import * | ||
| from .maintenance import * | ||
| from .maintenance import Maintenance, MaintenanceType # Replace with actual names needed from .maintenance | ||
| from .monitor import * | ||
| from .monitor_api import * | ||
| from .networking import * |
📝 Description
This project adds support for the new Host Maintenance Policy features.
✔️ How to Test
make test-unitmake test-int