From 4e2a087cc7e91a510dd590f7cc761e36ac8f77f8 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 12 Jul 2023 21:16:11 +0200 Subject: T5195: move boot_* helpers to vyos.utils.boot --- src/conf_mode/vpp.py | 3 ++- src/helpers/vyos_net_name | 7 +++---- src/op_mode/powerctrl.py | 2 +- src/services/vyos-configd | 9 ++++----- 4 files changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/conf_mode/vpp.py b/src/conf_mode/vpp.py index 87ebc3ea9..0b7a6993a 100755 --- a/src/conf_mode/vpp.py +++ b/src/conf_mode/vpp.py @@ -25,7 +25,8 @@ from vyos.configdep import set_dependents, call_dependents from vyos.configdict import dict_merge from vyos.configdict import node_changed from vyos.ifconfig import Section -from vyos.util import call, rc_cmd, boot_configuration_complete +from vyos.util import call, rc_cmd +from vyos.utils.boot import boot_configuration_complete from vyos.utils.system import sysctl_read, sysctl_apply from vyos.template import render from vyos.xml import defaults diff --git a/src/helpers/vyos_net_name b/src/helpers/vyos_net_name index 1798e92db..7431f3713 100755 --- a/src/helpers/vyos_net_name +++ b/src/helpers/vyos_net_name @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2021 VyOS maintainers and contributors +# Copyright (C) 2021-2023 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -13,8 +13,6 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# -# import os import re @@ -26,7 +24,8 @@ from sys import argv from vyos.configtree import ConfigTree from vyos.defaults import directories -from vyos.util import cmd, boot_configuration_complete +from vyos.util import cmd +from vyos.utils.boot import boot_configuration_complete from vyos.migrator import VirtualMigrator vyos_udev_dir = directories['vyos_udev_dir'] diff --git a/src/op_mode/powerctrl.py b/src/op_mode/powerctrl.py index dfacd45c2..2bb2e717b 100755 --- a/src/op_mode/powerctrl.py +++ b/src/op_mode/powerctrl.py @@ -104,7 +104,7 @@ def cancel_shutdown(): def check_unsaved_config(): from vyos.config_mgmt import unsaved_commits - from vyos.util import boot_configuration_success + from vyos.utils.boot import boot_configuration_success if unsaved_commits() and boot_configuration_success(): print("Warning: there are unsaved configuration changes!") diff --git a/src/services/vyos-configd b/src/services/vyos-configd index 48c9135e2..355182b26 100755 --- a/src/services/vyos-configd +++ b/src/services/vyos-configd @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2020 VyOS maintainers and contributors +# Copyright (C) 2020-2023 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -13,8 +13,6 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# -# import os import sys @@ -28,8 +26,9 @@ import zmq from contextlib import contextmanager from vyos.defaults import directories -from vyos.util import boot_configuration_complete -from vyos.configsource import ConfigSourceString, ConfigSourceError +from vyos.utils.boot import boot_configuration_complete +from vyos.configsource import ConfigSourceString +from vyos.configsource import ConfigSourceError from vyos.config import Config from vyos import ConfigError -- cgit v1.2.3