1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-09 19:56:48 +00:00

ci: replace super-linter with ruff

Super-linter ran from the unpinned :latest image and, because of
branches-ignore: [master], never on pull requests to master. Ruff now
checks syntax errors and pyflakes rules (E9, F) on every push and PR.

Fixes the existing findings: unused imports and variables, an unused
duplicate import in instances/tests.py, and the star import in
accounts/views.py. settings-dev.py keeps its star import of the base
settings.
This commit is contained in:
catborise 2026-10-03 12:26:00 +03:00
parent a8725ee325
commit b04f656d2b
31 changed files with 37 additions and 114 deletions

View file

@ -290,7 +290,7 @@ class CreateInstanceViewSet(viewsets.ViewSet):
volume_list.append(volume)
with utils.libvirt_compute_lock(compute):
ret = conn.create_instance(
conn.create_instance(
name=serializer.validated_data["name"],
memory=serializer.validated_data["memory"],
vcpu=serializer.validated_data["vcpu"],

View file

@ -4,7 +4,7 @@ disk and media mutation views must be superuser-only (matching the UI, where
the Disk tab is only rendered for superusers), and even for superusers the
views must not act on volumes or option values taken blindly from the client.
"""
from unittest.mock import MagicMock, patch
from unittest.mock import patch
from django.contrib.auth import get_user_model
from django.test import TestCase

View file

@ -271,7 +271,7 @@ class InstanceSecurityMutationsTestCase(TestCase):
with patch("instances.utils.connection_manager.host_is_up", return_value=True), \
patch("instances.utils.wvmInstances") as mock_instances_cls, \
patch("instances.utils.wvmInstance") as mock_instance_cls, \
patch("instances.utils.wvmInstance"), \
patch("instances.utils.transaction.atomic"), \
patch("instances.utils.Instance") as mock_instance_model:

View file

@ -10,7 +10,6 @@ from django.contrib.auth.models import Permission
from django.http.response import Http404
from django.shortcuts import reverse
from django.test import TestCase
from instances.views import instance
from libvirt import VIR_DOMAIN_UNDEFINE_NVRAM
from vrtManager.create import wvmCreate
from vrtManager.util import randomUUID