File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ def derived_data(
197197 """Add derived data to the device response."""
198198 addresses = {}
199199 interface_order = ["br0" , "eth0" , "ath0" ]
200+
200201 interfaces = response .get ("interfaces" , [])
201202
202203 # No interfaces, no mac, no usability
@@ -208,11 +209,12 @@ def derived_data(
208209 addresses [interface ["ifname" ]] = interface ["hwaddr" ]
209210
210211 for interface in interface_order :
211- response ["derived" ] = {
212- "mac" : addresses [interface ],
213- "mac_interface" : interface ,
214- }
215- return response
212+ if interface in interfaces :
213+ response ["derived" ] = {
214+ "mac" : addresses [interface ],
215+ "mac_interface" : interface ,
216+ }
217+ return response
216218
217219 # Fallback take fist alternate interface found
218220 response ["derived" ] = {
You can’t perform that action at this time.
0 commit comments