diff options
author | Benjamin Berg <bberg@redhat.com> | 2022-05-16 14:38:28 +0200 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2022-05-16 16:40:00 +0200 |
commit | 275db91afd6903ef7df4865ec3c844a873cb4227 (patch) | |
tree | c2fafa24c287ebcc1e5a9b1fdc7d40a29429c01e | |
parent | 4400ad0944b79dd1302f92ba223462e961098129 (diff) |
linux: Do not create intermediate proxy to fetch properties
There is no need for an intermediate proxy object, adding it just
results in extra overhead that is not needed.
-rwxr-xr-x | src/linux/integration-test.py | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py index 692f555..0ea0bef 100755 --- a/src/linux/integration-test.py +++ b/src/linux/integration-test.py @@ -243,26 +243,32 @@ class Tests(dbusmock.DBusTestCase): def get_dbus_property(self, name): '''Get property value from daemon D-Bus interface.''' - proxy = Gio.DBusProxy.new_sync( - self.dbus, Gio.DBusProxyFlags.DO_NOT_AUTO_START, None, UP, - '/org/freedesktop/UPower', 'org.freedesktop.DBus.Properties', None) - return proxy.Get('(ss)', UP, name) + return self.dbus.call_sync(UP, '/org/freedesktop/UPower', + 'org.freedesktop.DBus.Properties', + 'Get', GLib.Variant('(ss)', (UP, name)), + None, + Gio.DBusCallFlags.NO_AUTO_START, + -1, None).unpack()[0] def get_dbus_display_property(self, name): '''Get property value from display device D-Bus interface.''' - proxy = Gio.DBusProxy.new_sync( - self.dbus, Gio.DBusProxyFlags.DO_NOT_AUTO_START, None, UP, - UP_DISPLAY_OBJECT_PATH, 'org.freedesktop.DBus.Properties', None) - return proxy.Get('(ss)', UP + '.Device', name) + return self.dbus.call_sync(UP, UP_DISPLAY_OBJECT_PATH, + 'org.freedesktop.DBus.Properties', + 'Get', GLib.Variant('(ss)', (UP_DEVICE, name)), + None, + Gio.DBusCallFlags.NO_AUTO_START, + -1, None).unpack()[0] def get_dbus_dev_property(self, device, name): '''Get property value from an upower device D-Bus path.''' - proxy = Gio.DBusProxy.new_sync( - self.dbus, Gio.DBusProxyFlags.DO_NOT_AUTO_START, None, UP, device, - 'org.freedesktop.DBus.Properties', None) - return proxy.Get('(ss)', UP + '.Device', name) + return self.dbus.call_sync(UP, device, + 'org.freedesktop.DBus.Properties', + 'Get', GLib.Variant('(ss)', (UP_DEVICE, name)), + None, + Gio.DBusCallFlags.NO_AUTO_START, + -1, None).unpack()[0] def start_logind(self, parameters=None): self.logind, self.logind_obj = self.spawn_server_template('logind', |