From cae4d9c959a1f29c7da91adae869b7b61b5736f1 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 7 Apr 2022 18:34:41 +0200 Subject: vyos.base: T4346: add common DeprecationWarning() class (cherry picked from commit 957f73ed8c2c22afd5e56adc36b4d032b3f1a5f1) --- python/vyos/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/vyos/base.py b/python/vyos/base.py index c78045548..fd22eaccd 100644 --- a/python/vyos/base.py +++ b/python/vyos/base.py @@ -15,6 +15,12 @@ from textwrap import fill +class DeprecationWarning(): + def __init__(self, message): + # Reformat the message and trim it to 72 characters in length + message = fill(message, width=72) + print(f'\nDEPRECATION WARNING: {message}\n') + class ConfigError(Exception): def __init__(self, message): # Reformat the message and trim it to 72 characters in length -- cgit v1.2.3 From ed976b809d2ae330f8bfa575339a14b42121e8b8 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 7 Apr 2022 18:35:10 +0200 Subject: ipv6: T4346: deprecate CLI command to disable IPv6 address family (cherry picked from commit 0f7e5371e702d4e2389f6fa6dfbda11bc9da6257) --- src/conf_mode/system-ipv6.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/conf_mode/system-ipv6.py b/src/conf_mode/system-ipv6.py index 7fb2dd1cf..e6bcc12ad 100755 --- a/src/conf_mode/system-ipv6.py +++ b/src/conf_mode/system-ipv6.py @@ -17,6 +17,7 @@ import os from sys import exit +from vyos.base import DeprecationWarning from vyos.config import Config from vyos.configdict import dict_merge from vyos.configdict import leaf_node_changed @@ -49,6 +50,9 @@ def get_config(config=None): return opt def verify(opt): + if 'disable' in opt: + DeprecationWarning('VyOS 1.4 (sagitta) will remove the CLI command to '\ + 'disable IPv6 address family in the Linux Kernel!') pass def generate(opt): -- cgit v1.2.3