From: Douglas Bagnall Date: Wed, 28 Feb 2024 03:19:59 +0000 (+1300) Subject: pytest:audit_log_base: use string_is_guid() X-Git-Tag: tdb-1.4.11~1657 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cf9d4cae1e73077c463648a7fcc9cbf329c03ec;p=thirdparty%2Fsamba.git pytest:audit_log_base: use string_is_guid() Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/audit_log_base.py b/python/samba/tests/audit_log_base.py index fa5ecc7cace..e82b9bedf5a 100644 --- a/python/samba/tests/audit_log_base.py +++ b/python/samba/tests/audit_log_base.py @@ -21,10 +21,10 @@ import samba.tests from samba.messaging import Messaging from samba.dcerpc.messaging import MSG_AUTH_LOG, AUTH_EVENT_NAME from samba.param import LoadParm +from samba import string_is_guid import time import json import os -import re def getAudit(message): @@ -190,14 +190,9 @@ class AuditLogTestBase(samba.tests.TestCase): # No new messages. We’ve probably got them all. break - GUID_RE = re.compile( - "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}") - - # - # Is the supplied GUID string correctly formatted - # def is_guid(self, guid): - return self.GUID_RE.fullmatch(guid) + """Is the supplied GUID string correctly formatted""" + return string_is_guid(guid) def get_session(self): return self.auth_context["sessionId"]