[MERGED] osmo-gsm-tester[master]: cosmetic: SMS tokens: add modem name to SMS message

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon May 29 20:30:06 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: cosmetic: SMS tokens: add modem name to SMS message
......................................................................


cosmetic: SMS tokens: add modem name to SMS message

Change-Id: I66b8f30303e21ad781d16f3aa9fe30067d6a0e20
---
M src/osmo_gsm_tester/ofono_client.py
1 file changed, 7 insertions(+), 3 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/ofono_client.py
index c5ae1ff..ce937d0 100644
--- a/src/osmo_gsm_tester/ofono_client.py
+++ b/src/osmo_gsm_tester/ofono_client.py
@@ -340,9 +340,13 @@
         self.set_online()
         event_loop.wait(self, self.dbus.has_interface, I_NETREG, I_SMS, timeout=10)
 
-    def sms_send(self, to_msisdn, *tokens):
-        if hasattr(to_msisdn, 'msisdn'):
-            to_msisdn = to_msisdn.msisdn
+    def sms_send(self, to_msisdn_or_modem, *tokens):
+        if isinstance(to_msisdn_or_modem, Modem):
+            to_msisdn = to_msisdn_or_modem.msisdn
+            tokens = list(tokens)
+            tokens.append('to ' + to_msisdn_or_modem.name())
+        else:
+            to_msisdn = str(to_msisdn_or_modem)
         sms = Sms(self.msisdn, to_msisdn, 'from ' + self.name(), *tokens)
         self.log('sending sms to MSISDN', to_msisdn, sms=sms)
         mm = self.dbus.interface(I_SMS)

-- 
To view, visit https://gerrit.osmocom.org/2734
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I66b8f30303e21ad781d16f3aa9fe30067d6a0e20
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list