[PATCH] tests: Fix variant_from_dbus() for arrays of UInt32
- From: Frédéric Danis <frederic danis collabora com>
- To: networkmanager-list gnome org
- Subject: [PATCH] tests: Fix variant_from_dbus() for arrays of UInt32
- Date: Wed, 6 Mar 2019 11:59:02 +0100
Using test-networkmanager-servic.py, I get the following error when
trying to add manual config with a dns address:
Error: g-io-error-quark: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/dbus/service.py", line 707, in _message_cb
retval = candidate_method(self, *args, **keywords)
File "tools/test-networkmanager-service.py", line 1727, in AddConnection
return self.add_connection(con_hash)
File "tools/test-networkmanager-service.py", line 1731, in add_connection
con_inst = Connection(self.c_counter, con_hash, do_verify_strict)
File "tools/test-networkmanager-service.py", line 1601, in __init__
NmUtil.con_hash_verify(con_hash, do_verify_strict=do_verify_strict)
File "tools/test-networkmanager-service.py", line 497, in con_hash_verify
BusErr.raise_nmerror(e)
File "tools/test-networkmanager-service.py", line 419, in raise_nmerror
raise e
Exception: Unsupported value ipv4.dns = dbus.Array([dbus.UInt32(168430090L), dbus.UInt32(218893066L)],
signature=dbus.Signature('u'), variant_level=1) (Cannot convert array element to type 'u': Must be number,
not Variant)
---
tools/test-networkmanager-service.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py
index 711014efc..2fec2e26f 100755
--- a/tools/test-networkmanager-service.py
+++ b/tools/test-networkmanager-service.py
@@ -296,7 +296,7 @@ class Util:
if val.signature == 'y':
return GLib.Variant('ay', [int(x) for x in val])
if val.signature == 'u':
- return GLib.Variant('au', [Util.variant_from_dbus(x) for x in val])
+ return GLib.Variant('au', [int(x) for x in val])
if val.signature == 'ay':
return GLib.Variant('aay', [Util.variant_from_dbus(x) for x in val])
if val.signature == 'au':
--
2.18.0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]