summaryrefslogtreecommitdiff
path: root/src/op_mode/dns.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-03-23 08:31:28 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-03-23 08:31:28 -0500
commit7380bf1216399f905fe85ff26eaa0272b9f6dfe0 (patch)
tree1ac2d72db23a8de399dec58c9774860f903035f7 /src/op_mode/dns.py
parent31ca9c71fc09751b1114d104a8e09581f15c51d5 (diff)
downloadvyos-1x-7380bf1216399f905fe85ff26eaa0272b9f6dfe0.tar.gz
vyos-1x-7380bf1216399f905fe85ff26eaa0272b9f6dfe0.zip
op-mode: T5107: raise error instead of calling exit
Diffstat (limited to 'src/op_mode/dns.py')
-rwxr-xr-xsrc/op_mode/dns.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/op_mode/dns.py b/src/op_mode/dns.py
index a0e47d7ad..f8863c530 100755
--- a/src/op_mode/dns.py
+++ b/src/op_mode/dns.py
@@ -17,7 +17,6 @@
import sys
-from sys import exit
from tabulate import tabulate
from vyos.configquery import ConfigTreeQuery
@@ -75,8 +74,7 @@ def show_forwarding_statistics(raw: bool):
config = ConfigTreeQuery()
if not config.exists('service dns forwarding'):
- print("DNS forwarding is not configured")
- exit(0)
+ raise vyos.opmode.UnconfiguredSubsystem('DNS forwarding is not configured')
dns_data = _get_raw_forwarding_statistics()
if raw: