Skip to content

Commit 3dbe9c3

Browse files
author
3np
committed
fix(qubes-setup-dnat-to-ns): handle null dns dbus response as error
python typings indicate that resolve1.Get may return None. Handle this possibility as failure, falling back to resolv.conf
1 parent e5d626b commit 3dbe9c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

network/qubes-setup-dnat-to-ns

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ def get_dns_resolved():
6060
dns = resolve1.Get('org.freedesktop.resolve1.Manager',
6161
'DNS',
6262
dbus_interface='org.freedesktop.DBus.Properties')
63+
if dns is None:
64+
return get_dns_resolv_conf()
65+
6366
except dbus.exceptions.DBusException as s:
6467
error = s.get_dbus_name()
6568
if error in (

0 commit comments

Comments
 (0)