summaryrefslogtreecommitdiff
path: root/python/vyos/base.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-07 18:34:41 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-07 18:34:41 +0200
commit957f73ed8c2c22afd5e56adc36b4d032b3f1a5f1 (patch)
tree35f410520f887ba22b4c4b75ff4ff57dfd9ae460 /python/vyos/base.py
parent0bf386cee9b09d2e1a220330d3662c6ca2642645 (diff)
downloadvyos-1x-957f73ed8c2c22afd5e56adc36b4d032b3f1a5f1.tar.gz
vyos-1x-957f73ed8c2c22afd5e56adc36b4d032b3f1a5f1.zip
vyos.base: T4346: add common DeprecationWarning() class
Diffstat (limited to 'python/vyos/base.py')
-rw-r--r--python/vyos/base.py6
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