diff options
author | Christian Breunig <christian@breunig.cc> | 2025-05-04 12:17:06 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2025-05-05 17:22:57 +0200 |
commit | 40a99b1d00d822ef6f1a3772768919d14c3500d9 (patch) | |
tree | f2ba231f25e34dd3fcd3fa1dc7373ec5bddedc49 /src | |
parent | 59957ad694043f41a7b1e9ee740b19c87f297867 (diff) | |
download | vyos-1x-40a99b1d00d822ef6f1a3772768919d14c3500d9.tar.gz vyos-1x-40a99b1d00d822ef6f1a3772768919d14c3500d9.zip |
vyos.base: T7122: add new Message() helper wrapper for print()
This will wrap the messages at 72 characters in the same way as Warning() and
DeprecationWarning() would do. We now have simple wrappers for it!
Example:
vyos@vyos# commit
[ pki ]
Updating configuration: "load-balancing haproxy service frontend ssl
certificate LE_cloud"
Add/replace automatically imported CA certificate for "LE_cloud"
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/pki.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/pki.py b/src/conf_mode/pki.py index 98922595c..6957248d2 100755 --- a/src/conf_mode/pki.py +++ b/src/conf_mode/pki.py @@ -19,6 +19,7 @@ import os from sys import argv from sys import exit +from vyos.base import Message from vyos.config import Config from vyos.config import config_dict_merge from vyos.configdep import set_dependents @@ -231,7 +232,7 @@ def get_config(config=None): path = search['path'] path_str = ' '.join(path + found_path).replace('_','-') - print(f'PKI: Updating config: {path_str} {item_name}') + Message(f'Updating configuration: "{path_str} {item_name}"') if path[0] == 'interfaces': ifname = found_path[0] @@ -528,7 +529,7 @@ def generate(pki): if not ca_cert_present: tmp = dict_search_args(pki, 'ca', f'{autochain_prefix}{cert}', 'certificate') if not bool(tmp) or tmp != cert_chain_base64: - print(f'Adding/replacing automatically imported CA certificate for "{cert}" ...') + Message(f'Add/replace automatically imported CA certificate for "{cert}"...') add_cli_node(['pki', 'ca', f'{autochain_prefix}{cert}', 'certificate'], value=cert_chain_base64) return None |