Skip to contentSkip to conversation

auto-t: hostapd: raise exception upon invalid config

PATCH Applied James Prestwood 2 participants 2 messages Oct 22, 2019 – Oct 23, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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(+)
autotests/util/hostapd.py +3 -0
index 60750690..49047f38 100644
@@ -45,6 +45,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)
 
Signature · 1 line
2.17.1
#1 lore raw

Hi James,

Quoted 7 lines · James Prestwood

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(+)

Applied, thanks.

Regards,
-Denis