mirror of git://git.sysmocom.de/ofono
test: update deactivate-context to the new API
This commit is contained in:
parent
b775c434d9
commit
c6bdb48420
|
@ -16,22 +16,22 @@ for path in properties["Modems"]:
|
|||
|
||||
properties = modem.GetProperties()
|
||||
|
||||
if "org.ofono.DataConnectionManager" not in properties["Interfaces"]:
|
||||
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
|
||||
continue
|
||||
|
||||
connmgr = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.DataConnectionManager')
|
||||
connman = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.ConnectionManager')
|
||||
|
||||
properties = connmgr.GetProperties()
|
||||
contexts = connman.GetProperties()
|
||||
|
||||
if (properties["PrimaryContexts"] == []):
|
||||
if (len(contexts) == 0):
|
||||
print "No context available"
|
||||
sys.exit(1)
|
||||
|
||||
path = properties["PrimaryContexts"][0]
|
||||
path = contexts[0][0]
|
||||
|
||||
context = dbus.Interface(bus.get_object('org.ofono', path),
|
||||
'org.ofono.PrimaryDataContext')
|
||||
'org.ofono.ConnectionContext')
|
||||
|
||||
try:
|
||||
context.SetProperty("Active", dbus.Boolean(0))
|
||||
|
|
Loading…
Reference in New Issue