aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2021-09-22 16:35:55 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2021-10-01 14:05:43 +0200
commitf0241451d339000fd9608f52cd7c5951c9dfe6c1 (patch)
tree651fefc575b46e047bbb0d4ee3a70768d9b1c199
parent48e1b90eb883c5a124c8475298ff4344ec9e6623 (diff)
pySim-shell: verify_adm: turn error messages into exceptions
When verify_adm is used with scripts, especially bulk provisioning, then an exception is far more visible and allows us to spot problems with ADM verification quicker. Change-Id: I4162b43754efd061b6b9058b7ff8e1fc985e3538 Related: SYS#5617
-rwxr-xr-xpySim-shell.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/pySim-shell.py b/pySim-shell.py
index 06e14f6..6699c6f 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -310,13 +310,12 @@ class PySimCommands(CommandSet):
if pin_adm:
self._cmd.poutput("found ADM-PIN '%s' for ICCID '%s'" % (result, self._cmd.iccid))
else:
- self._cmd.poutput("cannot find ADM-PIN for ICCID '%s'" % (self._cmd.iccid))
- return
+ raise ValueError("cannot find ADM-PIN for ICCID '%s'" % (self._cmd.iccid))
if pin_adm:
self._cmd.card.verify_adm(h2b(pin_adm))
else:
- self._cmd.poutput("error: cannot authenticate, no adm-pin!")
+ raise ValueError("error: cannot authenticate, no adm-pin!")
@with_default_category('ISO7816 Commands')
class Iso7816Commands(CommandSet):