laforge has submitted this change. (
https://gerrit.osmocom.org/c/pysim/+/37834?usp=email )
Change subject: pySim.esim.saip.oid: Allow OID instance in prefix_match()
......................................................................
pySim.esim.saip.oid: Allow OID instance in prefix_match()
So far the prefix_match() required a string argument; let's also
permit another OID object to be passed; we internally convert that
to string.
Change-Id: I0feb7782d1813cc46ec78f170eb0fce804aebe3a
---
M pySim/esim/saip/oid.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/esim/saip/oid.py b/pySim/esim/saip/oid.py
index f201ffe..02ef23b 100644
--- a/pySim/esim/saip/oid.py
+++ b/pySim/esim/saip/oid.py
@@ -77,9 +77,9 @@
if self.cmp(other) > 0:
return True
- def prefix_match(self, oid_str):
+ def prefix_match(self, oid_str: Union[str, 'OID']):
"""determine if oid_str is equal or below our OID."""
- return oid_str.startswith(str(self))
+ return str(oid_str).startswith(str(self))
class eOID(OID):
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37834?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I0feb7782d1813cc46ec78f170eb0fce804aebe3a
Gerrit-Change-Number: 37834
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>