summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-03-31 15:21:49 +0200
committerChristian Breunig <christian@breunig.cc>2026-04-09 20:54:06 +0200
commitddc8b04203699430a33d2d78f27e8c3211def85e (patch)
treee7619c29150c6e7291a2ea063370526fa2e09558 /python
parent36c22d25b1f3e3685810a32248a88ee02fe06983 (diff)
downloadvyos-1x-ddc8b04203699430a33d2d78f27e8c3211def85e.tar.gz
vyos-1x-ddc8b04203699430a33d2d78f27e8c3211def85e.zip
T8375: general import cleanup on the way to serial activation
For the sake of nice grep lines and refactoring we have an unspoken - unwritten rule considered as folklore to have imports one per line. This helped in the past with refactorings.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/system/compat.py10
-rw-r--r--python/vyos/system/grub.py12
-rw-r--r--python/vyos/system/grub_util.py5
-rw-r--r--python/vyos/utils/serial.py4
4 files changed, 23 insertions, 8 deletions
diff --git a/python/vyos/system/compat.py b/python/vyos/system/compat.py
index f4a50b237..24cad7041 100644
--- a/python/vyos/system/compat.py
+++ b/python/vyos/system/compat.py
@@ -14,12 +14,18 @@
# along with this library. If not, see <http://www.gnu.org/licenses/>.
from pathlib import Path
-from re import compile, MULTILINE, DOTALL
+from re import compile
+from re import MULTILINE
+from re import DOTALL
from functools import wraps
from copy import deepcopy
from typing import Union
-from vyos.system import disk, grub, image, SYSTEM_CFG_VER
+from vyos.flavor import get_image_serial_console
+from vyos.system import disk
+from vyos.system import grub
+from vyos.system import image
+from vyos.system import SYSTEM_CFG_VER
from vyos.template import render
TMPL_GRUB_COMPAT: str = 'grub/grub_compat.j2'
diff --git a/python/vyos/system/grub.py b/python/vyos/system/grub.py
index 0f04fa5e9..50651d20e 100644
--- a/python/vyos/system/grub.py
+++ b/python/vyos/system/grub.py
@@ -16,13 +16,17 @@
import platform
from pathlib import Path
-from re import MULTILINE, compile as re_compile
+from re import MULTILINE
+from re import compile as re_compile
from shutil import copy2
-from uuid import uuid5, NAMESPACE_URL, UUID
+from uuid import uuid5
+from uuid import NAMESPACE_URL
+from uuid import UUID
-from vyos.template import render
-from vyos.utils.process import cmd, rc_cmd
from vyos.system import disk
+from vyos.template import render
+from vyos.utils.process import cmd
+from vyos.utils.process import rc_cmd
# Define variables
GRUB_DIR_MAIN: str = '/boot/grub'
diff --git a/python/vyos/system/grub_util.py b/python/vyos/system/grub_util.py
index e534334e6..344569168 100644
--- a/python/vyos/system/grub_util.py
+++ b/python/vyos/system/grub_util.py
@@ -13,7 +13,10 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this library. If not, see <http://www.gnu.org/licenses/>.
-from vyos.system import disk, grub, image, compat
+from vyos.system import disk
+from vyos.system import grub
+from vyos.system import image
+from vyos.system import compat
@compat.grub_cfg_update
def set_console_speed(console_speed: str, root_dir: str = '') -> None:
diff --git a/python/vyos/utils/serial.py b/python/vyos/utils/serial.py
index 36b483e91..5d276fb17 100644
--- a/python/vyos/utils/serial.py
+++ b/python/vyos/utils/serial.py
@@ -13,7 +13,9 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
-import os, re, json
+import os
+import re
+import json
from typing import List
from vyos.base import Warning