summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-11-20 16:58:43 +0100
committerChristian Poessinger <christian@poessinger.com>2022-11-20 17:00:29 +0100
commitda5bff2e835a14997d7b176670376cbd8d1221ef (patch)
tree1112b905e60334c40d67119611372f75900940e9 /src/op_mode
parentd34240d218998b81d5ff7fbfb4afbec39bf620e9 (diff)
downloadvyos-1x-da5bff2e835a14997d7b176670376cbd8d1221ef.tar.gz
vyos-1x-da5bff2e835a14997d7b176670376cbd8d1221ef.zip
op-mode: dns-forwarding: T4578: drop sudo calls
Commit 66288ccfee ("dns-forwarding: T4578: Rewrite show dns forwarding") added the implementation for the new standardized op-mode definitions/implementation. As the API daemon has the proper permissions and also the CLI op-mode calls the script already with "sudo", there is no need to call "sudo" inside this script, again. Also add dns.py to data/op-mode-standardized.json for the GraphQL schema to be generated.
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/dns.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/op_mode/dns.py b/src/op_mode/dns.py
index 9e5b1040c..a0e47d7ad 100755
--- a/src/op_mode/dns.py
+++ b/src/op_mode/dns.py
@@ -54,10 +54,10 @@ def _data_to_dict(data, sep="\t") -> dict:
def _get_raw_forwarding_statistics() -> dict:
- command = cmd('sudo /usr/bin/rec_control --socket-dir=/run/powerdns get-all')
+ command = cmd('rec_control --socket-dir=/run/powerdns get-all')
data = _data_to_dict(command)
data['cache-size'] = "{0:.2f}".format( int(
- cmd('sudo /usr/bin/rec_control --socket-dir=/run/powerdns get cache-bytes')) / 1024 )
+ cmd('rec_control --socket-dir=/run/powerdns get cache-bytes')) / 1024 )
return data