ofono_client: Fix race condition when checking for required features

I got a backtrace in which the modem was lacking feature 'net'. That
happens for 2 reasons:
1- net feature is not shown unless the modem is Online (at least for
sierra modems)
2- Even after it has been set online, a lapse of time can pass before
the feature gets shown.

This was added in 896f08f6ab
"fix: refresh dbus object when interfaces have changed"
with the expectation that the 'Features' list would be available in all
modem states. Since it depends on being powered and online, the same
functionality is already provided by checking the Interfaces list, hence
this code can be dropped entirely.

Change-Id: Iedd62235d1a3a8b917ad4ac0b61b9c5dbf0fe43c
This commit is contained in:
Pau Espin 2017-05-30 17:20:30 +02:00 committed by Neels Hofmeyr
parent 765c1d9ce3
commit 0993bf6f98
1 changed files with 0 additions and 9 deletions

View File

@ -243,14 +243,6 @@ class ModemDbusInteraction(log.Origin):
def is_online(self):
return self.property_is('Online', True)
def require_features(self, *required):
'''Make sure the given feature strings are present in
properties()['Features'], raise an exception otherwise.'''
features = set(self.properties().get('Features'))
r = set(required)
if not (r < features):
self.raise_exn('This modem lacks features:', r - features)
class Modem(log.Origin):
@ -265,7 +257,6 @@ class Modem(log.Origin):
self.set_log_category(log.C_TST)
self.sms_received_list = []
self.dbus = ModemDbusInteraction(self.path)
self.dbus.require_features('sms', 'net')
self.dbus.required_signals = {
I_SMS: ( ('IncomingMessage', self._on_incoming_message), ),
}