diff options
author | Viliam Luc <vluc@cisco.com> | 2022-03-31 11:01:25 +0200 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2022-04-04 11:46:00 +0000 |
commit | d743892c7ea9dcae6038660b57b94c9578f7f7f4 (patch) | |
tree | 685f8fa6a141818911f8c2e34c71de2e5eb9b629 /resources/tools/telemetry/bundle_bpf.py | |
parent | 944fdd776eb68211a3e58648d1d2ebd9a12f0636 (diff) |
telemetry: error message handling part2
Signed-off-by: Viliam Luc <vluc@cisco.com>
Change-Id: I4d8de4e6ccff25c0c1dcf66c192c56710939bf7d
Diffstat (limited to 'resources/tools/telemetry/bundle_bpf.py')
-rw-r--r-- | resources/tools/telemetry/bundle_bpf.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/resources/tools/telemetry/bundle_bpf.py b/resources/tools/telemetry/bundle_bpf.py index 655152cb27..b9baeab7ca 100644 --- a/resources/tools/telemetry/bundle_bpf.py +++ b/resources/tools/telemetry/bundle_bpf.py @@ -17,6 +17,7 @@ from logging import getLogger import sys from bcc import BPF +from .constants import Constants class BundleBpf: @@ -67,8 +68,8 @@ class BundleBpf: sample_period=duration ) except AttributeError: - getLogger(__name__).error(u"Cannot attach BPF events!") - sys.exit(1) + getLogger("console_stderr").error(u"Could not attach BPF events!") + sys.exit(Constants.err_linux_attach) def detach(self): """ @@ -81,8 +82,8 @@ class BundleBpf: ev_config=event[u"name"] ) except AttributeError: - getLogger(__name__).error(u"Cannot dettach BPF events!") - sys.exit(1) + getLogger("console_stderr").error(u"Could not detach BPF events!") + sys.exit(Constants.err_linux_detach) def fetch_data(self): """ |