mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-31 02:35:12 +03:00
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
This commit is contained in:
@@ -310,13 +310,12 @@ class PySimCommands(CommandSet):
|
|||||||
if pin_adm:
|
if pin_adm:
|
||||||
self._cmd.poutput("found ADM-PIN '%s' for ICCID '%s'" % (result, self._cmd.iccid))
|
self._cmd.poutput("found ADM-PIN '%s' for ICCID '%s'" % (result, self._cmd.iccid))
|
||||||
else:
|
else:
|
||||||
self._cmd.poutput("cannot find ADM-PIN for ICCID '%s'" % (self._cmd.iccid))
|
raise ValueError("cannot find ADM-PIN for ICCID '%s'" % (self._cmd.iccid))
|
||||||
return
|
|
||||||
|
|
||||||
if pin_adm:
|
if pin_adm:
|
||||||
self._cmd.card.verify_adm(h2b(pin_adm))
|
self._cmd.card.verify_adm(h2b(pin_adm))
|
||||||
else:
|
else:
|
||||||
self._cmd.poutput("error: cannot authenticate, no adm-pin!")
|
raise ValueError("error: cannot authenticate, no adm-pin!")
|
||||||
|
|
||||||
@with_default_category('ISO7816 Commands')
|
@with_default_category('ISO7816 Commands')
|
||||||
class Iso7816Commands(CommandSet):
|
class Iso7816Commands(CommandSet):
|
||||||
|
|||||||
Reference in New Issue
Block a user