summaryrefslogtreecommitdiff
path: root/daemons/lvmdbusd/utils.py
diff options
context:
space:
mode:
authorTony Asleson <tasleson@redhat.com>2022-08-31 11:20:49 -0500
committerTony Asleson <tasleson@redhat.com>2022-09-16 10:49:37 -0500
commitd42bdb07def72d68c05241823979b28952978c05 (patch)
treef099fdc4c7bbab3cfee630dacae61ae0d8f3cef3 /daemons/lvmdbusd/utils.py
parentcb32b0a87f9c2c5b9d79f02e59e3925d8350c70b (diff)
downloadlvm2-d42bdb07def72d68c05241823979b28952978c05.tar.gz
lvmdbusd: Re-work error handling
Introduce an exception which is used for known existing issues with lvm. This is used to distinguish between errors between lvm itself and lvmdbusd. In the case of lvm bugs, when we simply retry the operation we will log very little. Otherwise, we will dump a full traceback for investigation when we do the retry.
Diffstat (limited to 'daemons/lvmdbusd/utils.py')
-rw-r--r--daemons/lvmdbusd/utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/daemons/lvmdbusd/utils.py b/daemons/lvmdbusd/utils.py
index d5c37de46..6c7a25f8d 100644
--- a/daemons/lvmdbusd/utils.py
+++ b/daemons/lvmdbusd/utils.py
@@ -768,3 +768,12 @@ def extract_stack_trace(exception):
return ''.join(traceback.format_exception(None, exception, exception.__traceback__))
+class LvmBug(RuntimeError):
+ """
+ Things that are clearly a bug with lvm itself.
+ """
+ def __init__(self, msg):
+ super().__init__(msg)
+
+ def __str__(self):
+ return "lvm bug encountered: %s" % ' '.join(self.args)