In multiple cases the keys we are looking for will not exist. For example, wired clients will not have AP, channel, or RSSI values. Pending associations are not guaranteed to have all three of these fields added atomically.
One fix would be to hide these types of errors by building a nice 'Client' class and then programming the scripts to a stable, guaranteed interface. An effective stopgap is to do what I'm going with in this commit - to just use .get with some sane default instead of allowing a KeyError exception to happen when the keys do not exist
In multiple cases the keys we are looking for will not exist. For example, wired clients will not have AP, channel, or RSSI values. Pending associations are not guaranteed to have all three of these fields added atomically.
One fix would be to hide these types of errors by building a nice 'Client' class and then programming the scripts to a stable, guaranteed interface. An effective stopgap is to do what I'm going with in this commit - to just use
.get
with some sane default instead of allowing aKeyError
exception to happen when the keys do not exist