<p>Holger Freyther has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12976">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">modem: Do not connect to the systembus until a modem is in use<br><br>In case of the "virtual" tests we:<br><br>* Don't use ofono based modems (they are physical for now).<br>* Run in an environment that doesn't naturally run a dbus-daemon<br><br>Modify the code to memoize the bus by hand.<br><br>Change-Id: Ieae4bf819903402f7f715eb489e0a96ed59dc3f8<br>---<br>M src/osmo_gsm_tester/modem.py<br>1 file changed, 3 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/76/12976/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py</span><br><span>index 59e2136..f9b827a 100644</span><br><span>--- a/src/osmo_gsm_tester/modem.py</span><br><span>+++ b/src/osmo_gsm_tester/modem.py</span><br><span>@@ -29,7 +29,7 @@</span><br><span> Gio = get_introspection_module('Gio')</span><br><span> </span><br><span> from gi.repository import GLib</span><br><span style="color: hsl(0, 100%, 40%);">-bus = SystemBus()</span><br><span style="color: hsl(120, 100%, 40%);">+bus = None</span><br><span> </span><br><span> I_MODEM = 'org.ofono.Modem'</span><br><span> I_NETREG = 'org.ofono.NetworkRegistration'</span><br><span>@@ -66,6 +66,8 @@</span><br><span> </span><br><span> def systembus_get(path):</span><br><span>     global bus</span><br><span style="color: hsl(120, 100%, 40%);">+    if not bus:</span><br><span style="color: hsl(120, 100%, 40%);">+        bus = SystemBus()</span><br><span>     return bus.get('org.ofono', path)</span><br><span> </span><br><span> def list_modems():</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12976">change 12976</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/12976"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-gsm-tester </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ieae4bf819903402f7f715eb489e0a96ed59dc3f8 </div>
<div style="display:none"> Gerrit-Change-Number: 12976 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Holger Freyther <holger@freyther.de> </div>