Change in osmo-gsm-tester[master]: modem: Do not connect to the systembus until a modem is in use

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Holger Freyther gerrit-no-reply at lists.osmocom.org
Wed Feb 20 09:05:52 UTC 2019


Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/12976


Change subject: modem: Do not connect to the systembus until a modem is in use
......................................................................

modem: Do not connect to the systembus until a modem is in use

In case of the "virtual" tests we:

* Don't use ofono based modems (they are physical for now).
* Run in an environment that doesn't naturally run a dbus-daemon

Modify the code to memoize the bus by hand.

Change-Id: Ieae4bf819903402f7f715eb489e0a96ed59dc3f8
---
M src/osmo_gsm_tester/modem.py
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/76/12976/1

diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index 59e2136..f9b827a 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -29,7 +29,7 @@
 Gio = get_introspection_module('Gio')
 
 from gi.repository import GLib
-bus = SystemBus()
+bus = None
 
 I_MODEM = 'org.ofono.Modem'
 I_NETREG = 'org.ofono.NetworkRegistration'
@@ -66,6 +66,8 @@
 
 def systembus_get(path):
     global bus
+    if not bus:
+        bus = SystemBus()
     return bus.get('org.ofono', path)
 
 def list_modems():

-- 
To view, visit https://gerrit.osmocom.org/12976
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieae4bf819903402f7f715eb489e0a96ed59dc3f8
Gerrit-Change-Number: 12976
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther <holger at freyther.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190220/10e6c6c7/attachment.htm>


More information about the gerrit-log mailing list