diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-04-07 18:34:41 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-07 18:35:33 +0200 |
commit | cae4d9c959a1f29c7da91adae869b7b61b5736f1 (patch) | |
tree | 59781dfa38b04bf2d90e1b185cf5ef4ac9318858 /python | |
parent | 7bd5a1c76ed37b5c65622c730db827f90262941f (diff) | |
download | vyos-1x-cae4d9c959a1f29c7da91adae869b7b61b5736f1.tar.gz vyos-1x-cae4d9c959a1f29c7da91adae869b7b61b5736f1.zip |
vyos.base: T4346: add common DeprecationWarning() class
(cherry picked from commit 957f73ed8c2c22afd5e56adc36b4d032b3f1a5f1)
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/base.py | 6 |
1 files changed, 6 insertions, 0 deletions
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 |