diff options
author | Dan Williams <dcbw@redhat.com> | 2011-08-09 12:00:51 +0200 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2011-08-09 16:49:29 +0200 |
commit | f683391169cf7f143df380779bf69d6b9b3947b8 (patch) | |
tree | 29e5b3201b08f27039f073d6ab45bc0671dfecea /test/send-pin.py | |
parent | 33a97cdb139059a8f4e2a1fefe9f2c237171caf1 (diff) |
test: allow modem numbers in addition to object paths
If the command-line arg doesn't look like an object path,
treat it as the modem # and make the object path.
Diffstat (limited to 'test/send-pin.py')
-rwxr-xr-x | test/send-pin.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/send-pin.py b/test/send-pin.py index 3cf47ee3..002f1b09 100755 --- a/test/send-pin.py +++ b/test/send-pin.py @@ -33,7 +33,11 @@ if not sys.argv[2].isdigit(): os._exit(1) bus = dbus.SystemBus() -proxy = bus.get_object(MM_DBUS_SERVICE, sys.argv[1]) +objpath = sys.argv[1] +if objpath[:1] != '/': + objpath = "/org/freedesktop/ModemManager/Modems/" + str(objpath) +proxy = bus.get_object(MM_DBUS_SERVICE, objpath) + props = dbus.Interface(proxy, dbus_interface=DBUS_INTERFACE_PROPS) req = props.Get(MM_DBUS_INTERFACE_MODEM, "UnlockRequired") if req == "": |