From cdc9eb13aafc89eea709096ad65c7f5413846d07 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 22 Oct 2019 09:14:00 -0700 Subject: [PATCH] auto-t: hostapd: raise exception upon invalid config If the config file passed in is not found we would continue and eventually something else would fail. Instead immediately raise an exception to be more clear on what is actually failing. --- autotests/util/hostapd.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autotests/util/hostapd.py b/autotests/util/hostapd.py index 8af32e0d..209d8c24 100644 --- a/autotests/util/hostapd.py +++ b/autotests/util/hostapd.py @@ -37,6 +37,9 @@ class HostapdCLI: interface = intf break + if not interface: + raise Exception('config %s not found' % config) + self.ifname = interface.name self.socket_path = os.path.dirname(interface.ctrl_interface)