From f30c4bf578ea92a0b2e2be8974241444b6344589 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Mon, 13 May 2019 14:29:27 -0700 Subject: [PATCH] auto-t: handle exceptions correctly for start_ap The start_ap method was raising potential dbus errors before converting them to an IWD error type. This is due to dbus.Set() not taking an error handler. The only way to address this is to catch the error, convert it and raise the converted error. --- autotests/util/iwd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index 0ba2e5ab..c85160b7 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -425,7 +425,11 @@ class Device(IWDDBusAbstract): self._wait_for_async_op() def start_ap(self, ssid, psk): - self._prop_proxy.Set(IWD_DEVICE_INTERFACE, 'Mode', 'ap') + try: + self._prop_proxy.Set(IWD_DEVICE_INTERFACE, 'Mode', 'ap') + except Exception as e: + raise _convert_dbus_ex(e) + self._ap_iface = dbus.Interface(self._bus.get_object(IWD_SERVICE, self.device_path), IWD_AP_INTERFACE)