From 468beb0e2a124ed74bc31cdff71d214c89ae4cc6 Mon Sep 17 00:00:00 2001 From: Olivier Dautricourt Date: Thu, 13 Jan 2022 15:01:39 +0100 Subject: [PATCH] fixups: handle routing-rules https://github.com/seveas/python-networkmanager/pull/92 --- NetworkManager.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/NetworkManager.py b/NetworkManager.py index e66beba..b42d0d3 100644 --- a/NetworkManager.py +++ b/NetworkManager.py @@ -505,6 +505,15 @@ def to_dbus(klass, method, arg, val, signature): for cert in ['ca-cert', 'client-cert', 'phase2-ca-cert', 'phase2-client-cert', 'private-key']: if cert in settings[key]: settings[key][cert] = fixups.cert_to_dbus(settings[key][cert]) + if 'routing-rules' in settings[key]: + for rule in settings[key]['routing-rules']: + for p in rule: + if p == 'family': + rule[p] = dbus.Int32(rule[p]) + else: + rule[p] = dbus.UInt32(rule[p]) + settings[key]['routing-rules'] = dbus.Array( + settings[key]['routing-rules'], signature=dbus.Signature('a{sv}')) if 'ssid' in settings.get('802-11-wireless', {}): settings['802-11-wireless']['ssid'] = fixups.ssid_to_dbus(settings['802-11-wireless']['ssid']) if 'ipv4' in settings: