summaryrefslogtreecommitdiff
path: root/src/op_mode/dns.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/op_mode/dns.py')
-rwxr-xr-xsrc/op_mode/dns.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/op_mode/dns.py b/src/op_mode/dns.py
index a0e47d7ad..2168aef89 100755
--- a/src/op_mode/dns.py
+++ b/src/op_mode/dns.py
@@ -17,11 +17,10 @@
import sys
-from sys import exit
from tabulate import tabulate
from vyos.configquery import ConfigTreeQuery
-from vyos.util import cmd
+from vyos.utils.process import cmd
import vyos.opmode
@@ -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: