laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37855?usp=email )
Change subject: osmo-smdpp: Proper error handling in case ctxParams1 is missing member ......................................................................
osmo-smdpp: Proper error handling in case ctxParams1 is missing member
************* Module osmo-smdpp osmo-smdpp.py:373:15: E0601: Using variable 'iccid_str' before assignment (used-before-assignment)
Change-Id: I52bef18cbcc9f5d14519ff1473532c8502d45908 --- M osmo-smdpp.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/osmo-smdpp.py b/osmo-smdpp.py index a044b9b..3dbe9b1 100755 --- a/osmo-smdpp.py +++ b/osmo-smdpp.py @@ -368,9 +368,9 @@ with open(path, 'rb') as f: pes = saip.ProfileElementSequence.from_der(f.read()) iccid_str = b2h(pes.get_pe_for_type('header').decoded['iccid']) - - # make pylint happy: E0601: Using variable 'iccid_str' before assignment (used-before-assignment) - assert iccid_str + else: + # there's currently no other option in the ctxParams1 choice, so this cannot happen + raise ApiError('1.3.1', '2.2', 'ctxParams1 missing mandatory ctxParamsForCommonAuthentication')
# FIXME: we actually want to perform the profile binding herr, and read the profile metadat from the profile