unbound: ignore CalledProcessError and make a note about it

This commit is contained in:
Franco Fichtner 2022-07-15 13:48:10 +02:00
parent b7de99e08b
commit 31f3e82c6b

View File

@ -54,10 +54,10 @@ def unbound_control(commands, input=None, output_stream=None):
nl='\n'
input_string = f'{nl.join(input)}{nl}'
# XXX invoke can fail (non-zero exit code), but unclear why and what to do
subprocess.run(['/usr/sbin/chroot', '-u', 'unbound', '-g', 'unbound', '/',
'/usr/local/sbin/unbound-control', '-c', '/var/unbound/unbound.conf'] + commands,
input=input_string, stdout=output_stream, stderr=subprocess.STDOUT,
text=True, check=True)
input=input_string, stdout=output_stream, stderr=subprocess.STDOUT, text=True)
if output_stream:
output_stream.seek(0)