From cb114a649fac4f0d1e830789f91637865e991a68 Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Tue, 4 Oct 2016 16:26:39 -0700 Subject: [PATCH] auto-t: switch to 'get' for the optional fields --- autotests/util/iwd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index e20bc8db..092e45e4 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -218,7 +218,7 @@ class Device(IWDDBusAbstract): @rtype: object (Network) ''' - return self._properties('ConnectedNetwork') + return self._properties.get('ConnectedNetwork') @property def powered(self): @@ -379,8 +379,8 @@ class KnownNetwork(): def __init__(self, n_n_object): self._name = n_n_object['Name'] self._type = NetworkType.from_string(n_n_object['Type']) - self._last_connected_time = n_n_object['LastConnectedTime'] - self._last_seen_time = n_n_object['LastSeenTime'] + self._last_connected_time = n_n_object.get('LastConnectedTime') + self._last_seen_time = n_n_object.get('LastSeenTime') def __str__(self, prefix = ''): return prefix + 'Known Network:\n' \